Entering edit mode
5.3 years ago
salamandra
▴
550
I'm working on windows. I think I installed biopython with pip in a specific conda environment. Cause with:
conda activate models
pip install biopython
says:
Requirement already satisfied: biopython in c:\users\tania\.conda\envs\models\lib\site-packages (1.74)
Requirement already satisfied: numpy in c:\users\tania\appdata\roaming\python\python35\site-packages (from biopython) (1.16.3)
However when running in pycharm:
import biopython
Gives the error:
ImportError: No module named 'biopython'
I'm sure it's installed in correct env cause I've installed other python modules there and they worked. Tried to add variable to user path as explained here: https://www.opentechguides.com/how-to/article/windows-10/113/windows-10-set-path.html but it still doesn't work.
doesn't work with Bio either. Even after adding to path of system variables:
C:\Users\Tania\.conda\envs\models\Lib\site-packages
Is something missing?Can you do the following experiments and see where things break:
models
conda env, then runimport Bio
to see if that worksimport Bio
.import Bio
from within PyCharm.The above steps will tell you if it's python that's unable to see the module location or if PyCharm's the one acting funny. Step-1 confirms that you do have a working installation of biopython. Also, from each, print
sys.path
to see if the directory you added shows up in thePATH
variable.Fails at step 1:
Is biopython listen as one of the installed packages when you run
conda list -n models
(before activating the environment)?python and conda use virtual environments so you can make and throw away changes easily, but this flexibility comes at the cost of simplicity. Simply checking the PATH variable is not enough; if you know you installed it and the path is what it is, then it must not have been installed to the right virtual environment.