python - 为什么 setuptools 不理解 git+https URLs?

标签 python git setuptools

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

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"],
)

导致错误 Download error on git+https://github.com/wxWidgets/wxPython.git: unknown url type: git+https -- Some packages may not be found! 当我运行 python setup.py build && sudo setup.py install

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"
]

关于python - 为什么 setuptools 不理解 git+https URLs?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32383640/

相关文章:

python - 如何安装特定版本的 conda 软件包?

python-3.x - Python模块无法识别同一文件夹中的文件

python - 无法在 linux mint 上安装 setuptools

python - 为什么在我使用 distutils 时会创建一个 egg-info 文件?

python - 如何在 Pandas 中进行复杂的选择?

python - 是否可以使用 pandas.DataFrame.rolling 且步长大于 1?

python - Pandas 将多个数据帧合并到一个时间索引上,并使用所有其他数据帧的最新值

git - 为什么提交引入的更改没有显示在我的工作树中?

Git blame : View all Lines Authored by Specific User

git - 如何撤消 git rm 。 -r --cached 命令而不丢失任何未提交的更改?