我写了一个依赖于psutil的包(my-package
取决于third-party-package
哪个依赖于psutil
)。
由于它应该在没有任何连接且没有 的服务器上运行,因此我使用python 平台轮gcc
在本地准备了部署,然后将所有内容发送到服务器上。psutil
pip install my-package --download
现在服务器上的一切都准备好了,但是由于某种原因,当我运行安装时,pip
拒绝安装psutil
. 请注意,服务器是运行 pip 7.1.0、virtualenv 1.10.1 和 python 2.7.5 的 red hat 7.2(我无法更改任何版本)。
$ pip install /tmp/python_packages/my-package-1.4.zip --no-index
--find-links /tmp/python_packages/ --use-wheel
Ignoring indexes: https://pypi.python.org/simple/
# blablabla, everything goes fine, then
Downloading/unpacking psutil (from third-party-package>=0.9->my-package==1.4)
Could not find any downloads that satisfy the requirement psutil
(from third-party-package>=0.9->my-package==1.4)
Cleaning up...
No distributions at all found for psutil (from third-party-package>=0.9->my-package==1.4)
Storing complete log in /home/anto/.pip/pip.log
这里是pip.log
说:
Downloading/unpacking psutil (from third-party-package>=0.9->my-package==1.4)
URLs to search for versions for psutil (from third-party-package>=0.9->my-package==1.4):
# bla
Skipping file:///tmp/python_packages/psutil-4.2.0-cp27-cp27mu-linux_x86_64.whl
because it is not compatible with this Python
# bla
Could not find any downloads that satisfy the requirement psutil (from third-
party-package>=0.9->my-package==1.4)
Cleaning up...
所以“与这个 Python 不兼容”,好吧。但这是真正奇怪的部分:如果我安装psutil
没有其他任何东西,然后其余的,一切都很好。
$ pip install /tmp/python_packages/psutil-4.2.0-cp27-cp27mu-linux_x86_64.whl
Unpacking /tmp/python_packages/psutil-4.2.0-cp27-cp27mu-linux_x86_64.whl
Installing collected packages: psutil
Successfully installed psutil
Cleaning up...
$ pip freeze -l
psutil==4.2.0
$ pip install /tmp/python_packages/my-package-1.4.zip --no-index
--find-links /tmp/python_packages/ --use-wheel
# blablabla
Successfully installed my-package third-party-package
Cleaning up...
我错过了什么?有什么线索吗?