0

I'm trying to install Biopython but I've had some trouble. I've looked for an answer on the README, PDF manual and in other people's questions but they focus on more advanced problems while I'm still stuck at level 0.

I am a complete n00b so please, bear with me. I have downloaded python3 and installed it on my Mac.

python3 --version
Python 3.7.3


pip3 --version
pip 19.2.3 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)

I have then gone and downloaded biopython-1.77.tar.gz and uncompressed on my desktop.

From the biopython-1.77 folder, I did

python3 setup.py build

which I think worked OK (things moved on the screen). It was followed by

sudo python3 setup.py install

Likewise, I think this too worked.

Now, to test if the installation worked and if I'm ready to use Biopython I tried

python3

[>>>import Bio

but I get the error:

/Users/user/Desktop/biopython-1.77/Bio/__init__.py:126: BiopythonWarning: You may be importing Biopython from inside the source tree. This is bad practice and might lead to downstream issues. In particular, you might encounter ImportErrors due to missing compiled C extensions. We recommend that you try running your code from outside the source tree. If you are outside the source tree then you have a setup.py file in an unexpected directory: /Users/user/Desktop/biopython-1.77
  BiopythonWarning,

I then tried to do this from elsewhere and I changed directory to the Python3.8 folder and tried

    python3
[>>> import Bio

but I get the error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'Bio'

I've also tried to specify the path to Bio within biopython-1.77 but I get a SyntaxError: invalid syntax on the first "/" within the path.

Any help to install Biopython will be much appreciated.

Chris_Rands
  • 38,994
  • 14
  • 83
  • 119
  • 2
    Have you tried installing it with "pip install biopython" ? – petrubear May 31 '20 at 18:29
  • 2
    try `pip3 install biopython`, no need to do the installation from source like that normally – Chris_Rands May 31 '20 at 20:26
  • Thanks @petrubear and @Chris_Rands for the responses. I used `pip3 install biopython` and it worked like a treat. Again, apologies for the very silly question! – user13650382 May 31 '20 at 21:47
  • 1
    Does this answer your question? [biopython no module named Bio](https://stackoverflow.com/questions/49848517/biopython-no-module-named-bio) – Chris_Rands Jun 01 '20 at 16:02
  • 1
    just a recommendation for the future: Try installing python modules with conda (https://docs.conda.io/en/latest/miniconda.html). It is the easyiest way to install python (and other) modules and allows you to easily create different environments with different python modules/versions – jov14 Nov 03 '20 at 13:28

0 Answers0