【问题标题】:Problems with installing package from dependency_links从dependency_links安装包的问题
【发布时间】:2013-03-02 18:33:16
【问题描述】:

这是我的 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 安装文件://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

【问题讨论】:

  • 啊,对不起,我错了。
  • 您是在尝试sudo python setup.py sdist 还是只是python setup.py sdist
  • 我在一个用户下和一个 virtualenv 内运行这两个命令,而没有 sudo。

标签: python pip setuptools


【解决方案1】:

试试:

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

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

在 pip 1.5 中,处理依赖链接已被弃用,并在 pip 1.6 中被完全删除。

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

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

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

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

【讨论】:

    猜你喜欢
    • 2020-07-20
    • 2016-08-13
    • 1970-01-01
    • 1970-01-01
    • 2017-12-20
    • 2021-05-26
    • 2014-01-22
    • 2017-09-10
    相关资源
    最近更新 更多