从PyPI安装失败,版本不满意,但手动安装时PyPI中存在这些版本

2024-10-05 14:32:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我在尝试从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",
],

有人知道问题出在哪里吗?如果需要更多信息,请在评论中告诉我,我将编辑问题


Tags: installpipdjangofromhttpsorgtestpypi
1条回答
网友
1楼 · 发布于 2024-10-05 14:32:35

看起来有些“生产”包没有上传到测试索引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

相关问题 更多 >