gpt4 book ai didi

python - 从 dependency_links 安装包的问题

转载 作者:太空狗 更新时间:2023-10-29 21:58:48 28 4
gpt4 key购买 nike

这是我的 setup.py:

    setup(
...
install_requires=['GEDThriftStubs'],
dependency_links=['git+ssh://user@git.server.com/ged-thrift-stubs.git#egg=GEDThriftStubs'],
...)

然后我创建包:

python setup.py sdist

然后我尝试安装它:

pip install file://path/package-0.0.1.tar.gz

然后在终端中获取:

Downloading/unpacking GEDThriftStubs (from package==0.0.1)
Could not find any downloads that satisfy the requirement GEDThriftStubs (from package==0.0.1)
No distributions at all found for GEDThriftStubs (from package==0.0.1)

在 pip.log 消息中是这样的:

Skipping link git+ssh://user@git.server.com/ged-thrift-stubs.git#egg=GEDThriftStubs; wrong project name (not gedthriftstubs)

如果重要的话,我的项目中没有任何地方有确切的名称“gedthriftstubs”。

但这工作正常:

pip install git+ssh://user@git.server.com/ged-thrift-stubs.git#egg=GEDThriftStubs

最佳答案

尝试:

$ pip install --process-dependency-links file://path/package-0.0.1.tar.gz

请注意,此标记已从 pip 1.6 中的 pip 中删除。 See this article on pip.pypa.io了解更多信息。

In pip 1.5 processing dependency links was deprecated and it was removed completely in pip 1.6.

还有一个 lengthy discussion ( issue #1519 )关于 pip 和依赖链接

如果这不起作用,您可能还需要在链接上添加版本后缀,如下所示:

git+ssh://user@git.server.com/ged-thrift-stubs.git#egg=GEDThriftStubs-0.0.1

其中 0.0.1ged-thrift-stubs 的 setup.py 中指定的 version

关于python - 从 dependency_links 安装包的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15408782/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com