【问题标题】:Installing from PyPI fails with unsatisfiable version, but those exist in PyPI when installing them manually从 PyPI 安装失败,版本无法满足,但手动安装时 PyPI 中存在这些版本
【发布时间】:2020-12-26 12:56:12
【问题描述】:

我在尝试从 PyPI 安装我的包时遇到了一些奇怪的行为。

当我跑步时

pip install -i https://test.pypi.org/simple/ simple-api==0.0.0.0.5

失败了

ERROR: Could not find a version that satisfies the requirement singledispatch>=3.4.0.3 (from graphene-django->simple-api==0.0.0.0.5) (from versions: none)
ERROR: No matching distribution found for singledispatch>=3.4.0.3 (from graphene-django->simple-api==0.0.0.0.5)

但是,当我然后运行pip install singledispatch>=3.4.0.3 时,突然版本要求没有问题。在我以这种方式手动修复几个包后,pip 安装我的包没有问题。

setup.py 的可能相关部分:

install_requires=[
    "django",
    "graphene",
    "graphene-django",
],

有人知道问题可能是什么吗?如果需要更多信息,请在 cmets 中告诉我,我将编辑问题。

【问题讨论】:

    标签: python pypi


    【解决方案1】:

    看起来一些“生产”包没有上传到测试索引https://test.pypi.org/

    如果你想添加一个额外的包索引,使用--extra-index-url而不是-i

    pip install --extra-index-url https://test.pypi.org/simple/ simple-api==0.0.0.0.5
    

    【讨论】:

    • 哇,它确实是这样工作的!下次我可能不应该只是从教程中复制粘贴。谢谢!
    猜你喜欢
    • 2011-06-14
    • 2013-10-21
    • 2011-04-03
    • 2021-12-01
    • 1970-01-01
    • 2018-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多