<p>You should <strong>never</strong> install python packages as root or with <code>sudo</code>.</p>

<p>You're already using conda, so <code>conda install -c bioconda -c conda-forge dendropy</code>.</p>

CC BY-SA 4.0
2018-06-05T20:37:21.207Z
And why not install python packages as root ?
Ammar Sabir Cheema
CC BY-SA 4.0
2018-06-05T21:34:54.853Z
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
CC BY-SA 4.0
2018-06-05T12:44:17.343Z
2018-06-05T12:44:17.343Z
Devon Ryan
<p>I want to perform phylogenetic analysis using <a href="https://www.dendropy.org/" rel="nofollow noreferrer">Dendropy</a>. I have installed dendropy using command <code>sudo pip install -U dendropy</code> but when I import it in python3.5.1 it gives followinng error: </p>

<pre><code> &gt; 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.
 &gt;&gt;&gt; import dendropy
 Traceback (most recent call last):
 File "&lt;stdin&gt;", line 1, in &lt;module&gt;
 ImportError: No module named 'dendropy'
</code></pre>

<p>I again installed dendropy using the above given command as follows:</p>

<pre><code>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)
</code></pre>

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

<python><phylogenetics><phylogeny>
Issues installing Dendropy
# Issues installing Dendropy

(Asked by: username_0 on 2018-06-05)

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 "", line 1, in 
 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?

**Tags:** python, phylogenetics, phylogeny

---

## 1 answers

### Answer by username_1 on 2018-06-05. Score: 3 | Accepted answer

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`.

> **Comments:**
> **username_0**: And why not install python packages as root ?  
> **username_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.  

---

