我是Python的新手,需要使用一个基于python的工具,称为染色体,它可以导入一些python包,包括生物格式。Bioformats有许多模块,包括床。在运行染色体时,我得到了错误:
smeeta:~$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import chromosomer
>>> from chromosomer.cli import bioformats
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/chromosomer/cli.py", line 8, in <module>
import bioformats.bed
ImportError: No module named bed
>>> import bioformats
>>> import bioformats.bed
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named bed
>>>
如何安装软件包染色体及其依赖的软件包?
发布于 2016-12-19 12:45:10
使用pip
例如。
#>pip install <desired package>
#>pip install chromosomer
官方pip
文档link。
适用于Python 2.7.9+和3.4+的应预装pip
Python 2 2.7.8和Python 3≤3.3≤遵循此处的说明:https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip
有关此问题的更多讨论,请访问Does Python have a package/module management system?
发布于 2016-12-19 12:45:25
因此,在python中,大多数东西都是使用pip
命令安装的,这是安装Python包的推荐工具。
你也试过了吗:
pip install python-bioformats
发布于 2016-12-19 15:29:36
对于默认包以外的任何包,都需要在导入/使用之前进行安装。
安装Python包的最常用和最方便的方法是通过pip
包管理实用程序。
1.安装pip
sudo apt-get install python-pip # for Debian/Ubuntu
sudo yum -y install python-pip # for CentOS/RHEL
Python :为 2.7.9+和3.4+预装了pip
。
2.安装python包
sudo pip install chromosomer
它将安装bioinformats
、future
、pyfaidx
、PyVCF
、six
包作为依赖包。注意:如果已经是root
用户或正在使用vitualenv
,则不需要使用sudo
。
Verification -可以使用pip freeze
命令验证安装:
(venv_bioinformatics)[nahmed@localhost virtualenvs]$ pip freeze
bioformats==0.1.14
chromosomer==0.1.3
future==0.16.0
pyfaidx==0.4.8.1
PyVCF==0.6.8
six==1.10.0
wheel==0.24.0
测试-我安装了染色体并导入,工作正常:
(venv_bioinformatics)[nahmed@localhost virtualenvs]$ python
Python 2.7.5 (default, Sep 15 2016, 22:37:39)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from chromosomer.cli import chromosomer
>>>
https://stackoverflow.com/questions/41206852
复制相似问题