3

I want to perform phylogenetic analysis using Dendropy. I have installed dendropy using command sudo pip install -U dendropy but when I import it in python3.5.1 it gives followinng error:

 > python3
   Python 3.5.1 |Anaconda 2.5.0 (64-bit)| (default, Dec  7 2015, 11:16:01) 
   [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
   Type "help", "copyright", "credits" or "license" for more information.
 >>> import dendropy
 Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 ImportError: No module named 'dendropy'

I again installed dendropy using the above given command as follows:

sudo pip3 install -U dendropy
Requirement already up-to-date: dendropy in /usr/local/lib/python3.5/dist-packages (4.4.0)
Requirement not upgraded as not directly required: setuptools in /usr/local/lib/python3.5/dist-packages (from dendropy) (39.2.0)

After doing this again the error remains the same and I am still not able to import dendropy, any solution to this problem?

M__
  • 12,263
  • 5
  • 28
  • 47

1 Answers1

3

You should never install python packages as root or with sudo.

You're already using conda, so conda install -c bioconda -c conda-forge dendropy.

Devon Ryan
  • 19,602
  • 2
  • 29
  • 60
  • And why not install python packages as root ? – Ammar Sabir Cheema Jun 05 '18 at 20:37
  • 1
    You should always do as little as root as possible to minimize (A) the odds of screwing something up and (B) possible security problems. Further, later in your career you're likely to run into cases where you don't have the root password and IT will have you fired if you try to install packages as root on a central server. pip has a --user option for exactly such reasons. – Devon Ryan Jun 05 '18 at 21:34