No module named 'ete3'

3,306 views
Skip to first unread message

euma...@gmail.com

unread,
Apr 4, 2016, 8:45:07 AM4/4/16
to The ETE toolkit
Hi,
I wanted to use ete3 in order to use another library that uses it. I am working in Ubuntu. I have installed Anaconda (version 1.4.0). I have tried to follow the Using Conda installation from the "# Install ETE" step (since I understand that I do not have to install miniconda because I have Anaconda, right?). When I write in the terminal "ete3 version", it responds 3.0.0b35. I have also tried the native installation.

Now, when I tried to use ete3 in a jupyter notebook or my spyder and I write "import ete3" it says: "No module named 'ete3'".
The notebook says "ImportError: No module named 'ete3'"

I am stacked with this problem since last Friday and I don't want to tell all the things that I have broken and fix it again and I am exactly in the same place where I started, so I would be incredibly grateful if some could help me.

Best regards,
José

Jaime Huerta Cepas

unread,
Apr 4, 2016, 8:49:15 AM4/4/16
to eteto...@googlegroups.com
Hi José, 
You need to use the Anaconda/Miniconda Python version. For instance, you should make sure that you are using the jupyter notebook version installed with conda. 

Try:
'conda install ipython'   

and then start the notebook

best,
-jaime


--
You received this message because you are subscribed to the Google Groups "The ETE toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to etetoolkit+...@googlegroups.com.
To post to this group, send email to eteto...@googlegroups.com.
Visit this group at https://groups.google.com/group/etetoolkit.
For more options, visit https://groups.google.com/d/optout.

euma...@gmail.com

unread,
Apr 4, 2016, 9:00:50 AM4/4/16
to The ETE toolkit
Hi, thanks for the very fast answer. I have done what you said:


~$ conda install ipython
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ....
Solving package specifications: .........

# All requested packages already installed.
# packages in environment at /home/jose/anaconda3:
#
ipython 4.1.2 py35_1

And then i called jupyter with "jupyter notebook" and when I am there, it gives me anyway problems:
---> 19 from ete3 import Tree as EteTree
20
21 from . distance_metrics import minmax

ImportError: No module named 'ete3'

Anyway I don't think is so important that I have it the notebook; I am more concerned with the fact that Spyder does not import the module either:

In [1]: import ete3
Traceback (most recent call last):

File "<ipython-input-1-45d1dad00059>", line 1, in <module>
import ete3

ImportError: No module named 'ete3'

Please, help :(

Jaime Huerta Cepas

unread,
Apr 4, 2016, 9:05:54 AM4/4/16
to eteto...@googlegroups.com
do activate your anaconda environment before calling jupyter?

what does the command "which jupyter" say?

euma...@gmail.com

unread,
Apr 4, 2016, 9:29:59 AM4/4/16
to The ETE toolkit
Thanks again. I am realizing that I have no idea about Anaconda and that it doesn't work how I thought (I thought once you installed Anaconda, all this libraries are installed with python3 and that you can import them). Very basic questions: do I have to activate Anaconda in order to work with ete3? In the terminal of Ubuntu? Do I have to create an environment for Anaconda? Like this?

conda create --name tryingete3 python=3

? And then I have to activate it? In the Ubuntu terminal? How?

Sorry if my questions are too basic, I really don't know how to solve them :(

euma...@gmail.com

unread,
Apr 4, 2016, 9:30:59 AM4/4/16
to The ETE toolkit
Ups, sorry, I forgot!

jose@dell-desktop:~$ which jupyter
/home/jose/anaconda3/bin/jupyter

That is correct, right?

Jaime Huerta Cepas

unread,
Apr 4, 2016, 9:48:26 AM4/4/16
to eteto...@googlegroups.com
jose@dell-desktop:~$ which jupyter
/home/jose/anaconda3/bin/jupyter
That is correct, right?
yes, so, in the same terminal: 

-make sure you have ETE installed by running: 

"conda install -c etetoolkit ete3 ete3_external_apps"

-check that ete is actually there: 
ete3 version
python -c 'import ete3; print ete3'

-start jupyter:
notebook notebook

-do not close the terminal you used to start jupyter

This should work... If not, it might be an issue you your local environment
   



euma...@gmail.com

unread,
Apr 4, 2016, 9:58:46 AM4/4/16
to The ETE toolkit
Hi, right, appareanlty I am in the right path... So this steps worked:

#
# To activate this environment, use:
# $ source activate tryingete3
#
# To deactivate this environment, use:
# $ source deactivate
#
jose@dell-desktop:~$ ^C
jose@dell-desktop:~$ source activate tryingete3
discarding /home/jose/anaconda3/bin from PATH
prepending /home/jose/anaconda3/envs/tryingete3/bin to PATH
(tryingete3)jose@dell-desktop:~$ ete3 version
bash: ete3: command not found
(tryingete3)jose@dell-desktop:~$ conda install -c etetoolkit ete3 ete3_external_apps
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: ....

The following specifications were found to be in conflict:
- ete3 -> python
- ete3_external_apps -> python 2.7*|3.4*
- pip (target=pip-8.1.1-py35_1.tar.bz2) -> python 2.7*|3.4*
- pip (target=pip-8.1.1-py35_1.tar.bz2) -> setuptools
- python 3.5*
- setuptools (target=setuptools-20.3-py35_0.tar.bz2) -> python 2.6*|2.7*|3.3*|3.4*|3.5*
- wheel (target=wheel-0.29.0-py35_0.tar.bz2) -> python 2.7*|3.3*|3.4*|3.5*
Use "conda info <package>" to see the dependencies for each package.
(tryingete3)jose@dell-desktop:~$ ete3 version
bash: ete3: command not found


So apareantly, when trying to install ete3 in conda, it had some conflicts and wasn't able to install it. Right? Any way to fix it? Many thanks again!

Jaime Huerta Cepas

unread,
Apr 4, 2016, 10:05:18 AM4/4/16
to eteto...@googlegroups.com
you are activating a conda environment where ete is not installed. 

Copy/paste this to install:

wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O Miniconda-latest-Linux-x86_64.sh
bash Miniconda-latest-Linux-x86_64.sh -b -p ~/anaconda_ete/
export PATH=~/anaconda_ete/bin:$PATH;
# Install ETE

conda install -c etetoolkit ete3 ete3_external_apps
# install jupyter 
conda install ipython jupyter
# check ete
ete3 version
python -c 'import ete3; print ete3'
# Start jupyter
jupyter notebook



An use this to use any time later on:
export PATH=~/anaconda_ete/bin:$PATH;
jupyter notebook



euma...@gmail.com

unread,
Apr 5, 2016, 1:26:13 AM4/5/16
to The ETE toolkit
Hi Jaime,
I have done what you said and this still doesn't work. I don't want to bother you any longer. Maybe the problem is something in my computer, maybe the problem is in the module that uses ete. I think I am going to bother other people ;)
I am very thankful for your answers and your time.
Best regards,
José

bar...@berkeley.edu

unread,
Jun 3, 2016, 6:42:38 PM6/3/16
to The ETE toolkit, euma...@gmail.com
You may have to direct your notebook to where the packages are located. The sys module can be used to append that to the path. In your notebook script include the following (change the path as needed):

import sys
sys.path.append('/Users/user_one/anaconda_ete/lib/python2.7/site-packages/')

Jose Calvo

unread,
Jun 6, 2016, 1:18:24 AM6/6/16
to bar...@berkeley.edu, The ETE toolkit
Hi, I thank you for the answer. To be honest, I gave up trying it and decided to use another tool. But if I try it again in the future, I will remember that another possible solution was proposed.
Regards,
José Calvo

bioBalls

unread,
Apr 10, 2017, 7:26:10 AM4/10/17
to The ETE toolkit
I also have problems installing ete3/Notebook on my Windows Machine.

I Installed the Anaconda Python 2.7 Version.

Then in Windows Terminal/Eingabeaufforderung



U:\>conda install -c etetoolkit ete3 ete3_external_apps
Fetching package metadata ...............


PackageNotFoundError: Package not found: Conda could not find '


When I update to the lastest version of conda (conda update conda) I get the following message:

U:\>conda install -c etetoolkit ete3 ete3_external_apps
Fetching package metadata ...............


PackageNotFoundError: Package missing in current win-64 channels:
  - ete3_external_apps
 
 

 
"pip install ete3" works

U:\>pip install ete3
Collecting ete3
Installing collected packages: ete3
Successfully installed ete3-3.0.0b35


BUT

U:\>pip install etetoolkit
Collecting etetoolkit
  Could not find a version that satisfies the requirement etetoolkit (from versions: )
No matching distribution found for etetoolkit

AND

U:\>pip install ete3_external_apps
Collecting ete3_external_apps
  Could not find a version that satisfies the requirement ete3_external_apps (from versions: )
No matching distribution found for ete3_external_apps


So I can´t import any ete3 modules but Tree


If I check the version of ete3 I get:

U:\>ete3 version

Traceback (most recent call last):
  File "c:\users\user\appdata\local\continuum\anaconda2\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\users\user\appdata\local\continuum\anaconda2\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Users\user\AppData\Local\Continuum\Anaconda2\Scripts\ete3.exe\__main__.py", line 5, in <module>
  File "c:\users\user\appdata\local\continuum\anaconda2\lib\site-packages\ete3\tools\ete.py", line 54, in <module>
    from . import (ete_split, ete_expand, ete_annotate, ete_ncbiquery, ete_view,
  File "c:\users\user\appdata\local\continuum\anaconda2\lib\site-packages\ete3\tools\ete_view.py", line 48, in <module>
    from .. import (Tree, PhyloTree, TextFace, RectFace, faces, TreeStyle, CircleFace, AttrFace,
ImportError: cannot import name TextFace




Did I do something wrong?

I think I got the same error on my cluster, when I tried installing it


Greetings
Armin

Jaime Huerta Cepas

unread,
Apr 10, 2017, 11:44:07 AM4/10/17
to eteto...@googlegroups.com
Hi Armin, 
ete is not officially supported in Windows (i.e. no conda packages are released).
The API functionality (i.e. ete3 module) and visualization is however compatible, but you will need to install dependencies manually (i.e. PyQt).

best,
-jaime


--
You received this message because you are subscribed to the Google Groups "The ETE toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to etetoolkit+unsubscribe@googlegroups.com.

teunis.j...@gmail.com

unread,
Apr 18, 2017, 6:08:38 AM4/18/17
to The ETE toolkit, bar...@berkeley.edu
I've had the same problem, but I have been able to fix it painlessly. I am not sure if this will apply to you Jose, but I created a separate environment for my python3.5 conda installation. I can switch to it using "source activate py35". If you install ete3 using "conda install -c etetoolkit ete3" whilst not in the correct python environment, ete3 gets installed in a generic location that is not used by python (in my particular environment). It will then be unable to locate the ete3 module.

Try "find -name ete3" and see where the location of the module is. For me it is now in two locations:

(py35) $:~:find -name ete3
./anaconda3/envs/py35/bin/ete3
./anaconda3/envs/py35/lib/python3.5/site-packages/ete3-3.0.0b36-py3.5.egg/ete3 <-- correct location
./anaconda3/pkgs/ete3-3.0.0b36-py_0/site-packages/ete3-3.0.0b36-py3.5.egg/ete3
./anaconda3/pkgs/ete3-3.0.0b36-py_0/python-scripts/ete3
./anaconda3/bin/ete3
./anaconda3/lib/python3.5/site-packages/ete3-3.0.0b36-py3.5.egg/ete3 <-- wrong location







Op maandag 6 juni 2016 07:18:24 UTC+2 schreef Jose Calvo:
Reply all
Reply to author
Forward
0 new messages