让我们以 https://pypi.python.org/pypi/py-dom-xpath 为例.在这种情况下,包存储库托管在 http://code.google.com/p/py-dom-xpath/ 中。 .
我在 Windows 7 上使用 Python 2.7。
pip install py-dom-xpath
Downloading/unpacking py-dom-xpath
Could not find any downloads that satisfy the requirement py-dom-xpath
Some externally hosted files were ignored (use --allow-external py-dom-xpath to allow).
Cleaning up...
No distributions at all found for py-dom-xpath
Storing debug log for failure in C:\Users\insrkum\pip\pip.log
pip install --allow-external py-dom-xpath
You must give at least one requirement to install (see "pip help install")
pip install --allow-all-external py-dom-xpath
Downloading/unpacking py-dom-xpath
Could not find any downloads that satisfy the requirement py-dom-xpath
Some insecure and unverifiable files were ignored (use --allow-unverified py-dom-xpath to allow).
Cleaning up...
No distributions at all found for py-dom-xpath
Storing debug log for failure in C:\Users\insrkum\pip\pip.log
我尝试使用 --index-url 选项但没有成功。有效的是以下命令
pip install http://py-dom-xpath.googlecode.com/files/py-dom-xpath-0.1.tar.gz
这不是安装外部托管包存储库的最佳方式。我有兴趣使用 --allow-external 或 --allow-all-external。 我还想了解如何将 --upgrade 选项用于外部托管的包存储库。
最佳答案
Pip 1.5 是安全的:你需要 --allow-external
来下载外部托管的包
和 --allow-unverified
从“http”站 pip 下载。
你可以用
pip install --allow-all-external --allow-unverified py-dom-xpath py-dom-xpath
和
pip install --allow-all-external --allow-unverified py-dom-xpath py-dom-xpath --upgrade
关于python - 如何使用 pip 1.5(在 Python 上)安装和升级外部托管的包存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21128050/