即使依赖项存在,test.pypi上的模块也无法安装

时间:2020-03-26 13:10:42

标签: python setuptools pypi

我做了这个小包装,想在我的社区中分发。它现在位于test.pypi上,当我想尝试安装它时,出现了一个错误,即找不到依赖项。

setup.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'

1 个答案:

答案 0 :(得分:4)

-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