我想安装Biopython模块。所以我使用了命令sudo apt-get install python-biopython
。这会安装包。现在如果我在Python中键入import Bio
,编译器找不到给出ImportError: no module named Bio
的模块。不安装包意味着安装模块吗?
答案 0 :(得分:5)
我正在使用3.4.0
由于您使用的是Python 3.4,因此通过apt-get
安装的Debian软件包只会安装Python2.x版本,因此无效。
要安装Python 3版本,我建议使用pip。这里是如何安装的(注意这个包可能不有Python 3版本):
How to install pip with Python 3?
修改强>
如果仍然无法让import
使用python2,请尝试以下操作:
import sys
sys.path.append('/usr/share/pyshared')
import Bio
根据this package's files list,文件被安装到我在默认sys.path
列表中看不到的特殊目录