这个问题在这里已经有了答案:
Pip install from pypi works, but from testpypi fails (cannot find requirements)
(2 个回答)
1年前关闭。
我已经完成了我想在我的社区中分发的这个小包。它现在在 test.pypi 上,当我想尝试安装它时,它会给出一个错误,即找不到依赖项。
安装程序.py
...
install_requires=[
'defcon>=0.6.0',
'fonttools>=3.31.0'
]
...
抛出此错误
ERROR: Could not find a version that satisfies the requirement defcon>=0.6.0 (from sameWidther==0.6) (from versions: none)
ERROR: No matching distribution found for defcon>=0.6.0 (from sameWidther==0.6)
但是当我手动安装时,它可以工作
pip install 'fonttools>=3.6.0'
pip install 'defcon>=0.6.0'
最佳答案
-i URL
, 或 --index-url URL
表示“使用 URL 专门安装软件包”。通过 -i https://test.pypi.org/simple/
,因此您禁止从 PyPI (https://pypi.org/simple
) 搜索和下载包。要同时使用这两个索引,请使用 --extra-index-url
:
$ python -m pip install --extra-index-url https://test.pypi.org/simple/ sameWidther
关于python - test.pypi 上的模块无法安装依赖项,即使它们存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60868060/