python - 安装 Biopython : ImportError: No module named Bio

标签 python fedora biopython python-install

尝试在 Fedora 21、Python 2.7 上安装 Biopython。我做了以下事情

[mike@localhost Downloads](17:32)$ sudo pip2.7 install biopython
You are using pip version 6.1.1, however version 7.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting biopython
/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading biopython-1.65.tar.gz (12.6MB)
    100% |████████████████████████████████| 12.6MB 33kB/s 
Installing collected packages: biopython
  Running setup.py install for biopython
Successfully installed biopython-1.65

然后

[mike@localhost Downloads](17:32)$ ipython
Python 2.7.9 |Anaconda 2.2.0 (64-bit)| (default, Mar  9 2015, 16:20:48) 

In [1]: import Bio
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-a7440e1156be> in <module>()
----> 1 import Bio

ImportError: No module named Bio

我做错了什么?

编辑

我尝试使用

安装 biopython
sudo easy_install -f http://biopython.org/DIST/ biopython

并将其安装到/usr/lib/python2.7/site-packages/biopython-1.65-py2.7-linux-x86_64.egg/。没用。

然后我尝试使用相同的命令安装它,但没有 sudo:

easy_install -f http://biopython.org/DIST/ biopython

将其安装到/home/mike/anaconda/lib/python2.7/site-packages/biopython-1.65-py2.7-linux-x86_64.egg

成功了! ipython 和 python。但为什么它起作用了……?

最佳答案

在使用 pip 和类似的东西时应该非常小心,因为 pip 与假定的 Python 解释器一起使用。

我看到您正在尝试从通过键入 ipython 获得的 Python 解释器导入 Bio。您可以确保像这样调用此解释器的 pip:

sudo ipython -m pip install biopython

请注意,安装不是 ipython 独有的。它但是对于安装在其上的任何 Python 安装 ipython 都是独有的。

关于python - 安装 Biopython : ImportError: No module named Bio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31706293/

相关文章:

python - 列表正在作为字符串从 csv 中读取

python - 在 theano 中动态创建符号表达式

python - 我们如何根据分数将成对映射的字符串转换为多组字符串?

python - 使用 BioPython 根据限制序列过滤 FASTA 文件

python - 从 Cron 运行时,Python 中的 Popen 返回不同的输出(与命令行相比)

c++ - Fedora 中 boost 的使用

c - linux 机器中的哪个文件代表 gcc 标准 c 库?

linux - 如何执行命令 'appcfg rollback' ?

python - 读取多个blast文件(biopython)

biopython - 如何连接由 Bio.SeqIO.index 创建的两个或多个字典?