找不到满足要求的版本

10 浏览
0 Comments

找不到满足要求的版本

我正在Ubuntu 12.04中使用以下的requirements.txt文件安装几个Python包:

numpy>=1.8.2,<2.0.0
matplotlib>=1.3.1,<2.0.0
scipy>=0.14.0,<1.0.0
astroML>=0.2,<1.0
scikit-learn>=0.14.1,<1.0.0
rpy2>=2.4.3,<3.0.0

以及以下两个命令:

$ pip install --download=/tmp -r requirements.txt
$ pip install --user --no-index --find-links=/tmp -r requirements.txt

(第一个命令下载包,第二个命令安装它们)。

该过程经常会出现以下错误:

找不到满足要求  (from matplotlib<2.0.0,>=1.3.1->-r requirements.txt (line 2)) (from versions: )
找不到符合要求的分发  (from matplotlib<2.0.0,>=1.3.1->-r requirements.txt (line 2))

我用以下命令手动修复这个问题:

pip install --user 

然后再次运行第二个pip install命令。

但这只适用于特定的包。当我再次运行第二个pip install命令时,这次的错误是关于另一个所需的包,我需要重复这个过程,即手动安装新的所需包(使用上述命令),然后再次运行第二个pip install命令。

到目前为止,我不得不手动安装sixpytznose,现在又出错了,需要mock

有没有办法告诉pip自动安装所有需要的依赖项,这样我就不必一个一个手动安装了?

补充:顺便提一下,这只发生在Ubuntu 12.04上。在Ubuntu 14.04上,对requirements.txt文件使用pip install命令没有问题。

0