简体   繁体   中英

module not found error Bio in miniconda environment

I installed bio python as

pip install biopython as well as conda install -c conda-forge biopython . I see in site-packages. for some reason there is Bio dependency. How do I resolve this dependency?

 Type "help", "copyright", "credits" or "license" for more information.
>>> import bio
>>> bio.__version__
'1.75'
>>> from bio import pairwise2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../miniconda/lib/python3.7/site-packages/bio/pairwise2.py", line 246, in <module>
    from Bio import BiopythonWarning
ModuleNotFoundError: No module named 'Bio'
>>> 

Apparently, renaming bio as Bio in sitepackages then it works

Python 3.7.4 (default, Aug 13 2019, 15:17:50) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Bio
>>> from Bio import pairwise2
>>> 

I have searched on google how to install biopython using pip in this link .

  1. You need to type pip install biopython or pip install biopython --user

  2. Then import Bio(it is with B not b)

import Bio
print(Bio.__version__) 

I'm sure documentation is always a good start which you can find here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM