python - test.pypi 上的模块无法安装依赖项,即使它们存在

标签 python setuptools pypi

这个问题在这里已经有了答案:





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/

相关文章:

python - 分发支持 Python 的大型应用程序 : best practices

python - 不允许编辑 '...' 包信息

python - 如何不在 .pypirc 中存储密码?

python - 除了 PyPI 的 tarball 之外,我还应该准备鸡蛋和 zip 吗?

python - 哪些语言具有与 Numpy 相似或等效的数组切片符号,为什么它不更常见?

python - 将 Python 模块导入 Jinja 模板?

python - 使用 setuptools 创建符号链接(symbolic link)

Python 打包 : exclude directory from bdist_wheel

python - 带有通配符的瓶路由禁用 css 样式

c++ - 检查两个正则表达式是否相等/同构的库