biopython no module named Bio

前端 未结 11 1279
夕颜
夕颜 2021-01-17 10:15

FYI: this is NOT a duplicate!

Before running my python code I installed biopython in the cmd prompt:

pip install biopython

I then

相关标签:
11条回答
  • 2021-01-17 10:42

    When I came across this problem I noticed that after I installed biopython using pip install biopython the module directory in the site-packages folder was written with lowercase instead of uppercase letters. All in all, the folder was named bio instead Bio, so I just renamed the folder and everything started to work just fine. I am new to programing so I am aware this isn't the most elegant solution but it worked for me so I hope my answer will be useful to some of you. :)

    0 讨论(0)
  • 2021-01-17 10:44

    I could not import biopython when running python on windows.

    I tried several solutions by changing the directory names to upper/lower case as https://stackoverflow.com/a/60753930/10884907 and also different way of calling when import using "Bio", "bio", "biopyhton". None was working.

    But, It works in linux as simple as in manual guideliens, I did pip3 install biopython and with import Bio works!

    0 讨论(0)
  • 2021-01-17 10:48

    I had the same error. it turns out

    import Bio

    works

    instead of import biopython !

    0 讨论(0)
  • 2021-01-17 10:50

    I tried pip3 install biopython but it didn't work for me.

    But this works! - !pip install biopython

    0 讨论(0)
  • 2021-01-17 10:51

    On windows it installs the bio package in a top level directory named bio with lower case b. To fix the problem rename the directory to upper case b, Bio.

    Obviously the biopython people don't pay much attention to the win

    0 讨论(0)
  • 2021-01-17 10:57

    I just hit this issue with the problem being lower-case bio vs upper-case Bio. Turns out the problem was that it installs differently on python 2 and 3. In Python 2 you do import Bio, but in python 3 import bio. If you're hitting this issue it might be for the same reason, and the solution is probably to make sure you use the right name for the Python version you're on.

    0 讨论(0)
提交回复
热议问题