python - 如何使用 pip 1.5(在 Python 上)安装和升级外部托管的包存储库?

标签 python python-2.7 pip

让我们以 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/

相关文章:

python - Django manage.py runserver 无法响应

python - 如何在 Python 中声明一个全局常量?

python - Odoo - 如何读取/获取另一个模块中的字段值

python - 使用 pip 安装私有(private) github 存储库时遇到问题

python 画中画 : Does the order in which options are specified matter?

python - 如何使用装饰器将参数绑定(bind)到静态方法函数?

python - 如何让 python 2.7 进入 Redhat 6.5 Linux 的系统路径

python - 基于月份提取 pandas 数据框的子集

python - Selenium 无法在 Internet Explorer 9 中切换到 TinyMCE iframe

python - 以后如何下载 PyPI 包用于 pip 安装?