[英]Install package from conda for a specific version of python
我在处理 python 库方面相对较新,所以这可能是一个愚蠢的问题,但这里是详细的问题:
我正在使用 Linux 并尝试使用 python 3.7 使用 python 程序( ORF-rater
)。 不幸的是,当我运行程序时,出现以下错误:
ImportError: cannot import name 'maketrans' from 'string'
我认为这与这个问题有关。 因此,我想使用另一个版本的 Python(例如 3.4 或 2.7)来支持这个maketrans
。
我正在使用的程序还使用 Python 包plastid
,我使用 Conda conda install -c bioconda plastid
它,我猜它运行良好。
但是,它仅在 python 3.7 上安装了该软件包,并且我找不到为 python 3.4 安装的方法(我尝试了其他方法,例如pip3.4 install plastid
,但它没有用,很可能是因为我正在研究大学服务器,我无权这样做)。
以下代码创建了一个具有特定 python 版本的环境(2.7,因为3.4 不是一个选项),然后您激活它并安装您需要的包。
conda create -n test python=2.7
conda activate test
conda install -c bioconda plastid
python
然后在Python中,我做了以下并且没有错误
from string import maketrans
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.