首页 > 解决方案 > Biopython - 关于如何安装的非常基本的问题

问题描述

我正在尝试安装 Biopython,但遇到了一些麻烦。我已经在自述文件、PDF 手册和其他人的问题中寻找答案,但他们专注于更高级的问题,而我仍然停留在 0 级。

我是一个完整的n00b,所以请多多包涵。我已经下载了 python3 并将其安装在我的 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)

然后我去下载 biopython-1.77.tar.gz 并在我的桌面上解压缩。

从 biopython-1.77 文件夹中,我做到了

python3 setup.py build

我认为工作正常(屏幕上的东西移动了)。紧随其后的是

sudo python3 setup.py install

同样,我认为这也有效。

现在,为了测试安装是否有效以及我是否准备好使用 Biopython,我尝试了

python3

[>>>进口生物

但我得到了错误:

/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,

然后我尝试从其他地方执行此操作,并将目录更改为 Python3.8 文件夹并尝试

    python3
[>>> import Bio

但我得到了错误:

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

我也尝试在 biopython-1.77 中指定 Bio 的路径,但我得到一个 SyntaxError: invalid syntax on the first "/" 在路径中。

任何安装 Biopython 的帮助将不胜感激。

标签: pythonmacosinstallationbioinformaticsbiopython

解决方案


推荐阅读