从dependency_links安装包的问题

时间:2013-03-14 12:04:04

标签: python pip setuptools

这是我的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

1 个答案:

答案 0 :(得分:1)

尝试:

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

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

  

在pip 1.5中,处理依赖关系链接已弃用,并且已在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.1version

的setup.py中指定的ged-thrift-stubs
相关问题