根据 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/