为什么 setuptools 不理解 git+https URL?

Why does setuptools not understand git+https URLs?

根据 Dependency section in the setuptools manual git 存储库 URL 可以在 setupgit+URLdependency_links 参数中指定。然而,

cd /tmp
mkdir py-test
cd py-test
touch __init__.py

并使用

创建 setup.py 文件
from setuptools import setup, find_packages
from pkg_resources import parse_version

setup(
    name = "py-test",
    version = "1.0",
    packages = ["."],
    dependency_links = [
        "git+https://github.com/wxWidgets/wxPython.git"
    ],
    install_requires = ["wxPython"],
)

当我 运行 python setup.py build && sudo setup.py install.

时导致错误 Download error on git+https://github.com/wxWidgets/wxPython.git: unknown url type: git+https -- Some packages may not be found!

软件包 python-setuptools-git 的安装没有帮助。

我在 Ubuntu 15.04 上使用 setuptools 18.2 和 python 2.7。

来自setuptools docs

In the case of a VCS checkout, you should also append #egg=project-version in order to identify for what package that checkout should be used

所以修复只是将 #egg=wxPython 片段附加到末尾:

dependency_links = [
    "git+https://github.com/wxWidgets/wxPython.git#egg=wxPython"
]