【问题标题】:Why does setuptools not understand git+https URLs?为什么 setuptools 不理解 git+https 的 URL?
【发布时间】:2015-11-29 18:16:12
【问题描述】:

根据Dependency section in the setuptools manual git 可以在setupgit+URLdependency_links 参数中指定存储库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"],
)

在我运行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。

【问题讨论】:

    标签: python git setuptools


    【解决方案1】:

    来自setuptools docs

    在 VCS 结帐的情况下,您还应该附加 #egg=project-version 以确定应该使用哪个包进行结帐

    所以解决方法就是将#egg=wxPython 片段附加到末尾:

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

    【讨论】:

    • 仅供参考,如果从 pip 安装,您需要 version 部分,并且它需要是一个数字。例如#egg=wxPython-1.0
    猜你喜欢
    • 2020-02-08
    • 1970-01-01
    • 2016-06-01
    • 2015-06-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多