TestPyPI 的 Pip 安装失败:缺少要求
尝试从 TestPyPI 安装 Python 包时,您可能会遇到一条错误,指出需要找不到依赖项,例如 tqdm 和 Jinja2。这是因为 TestPyPI 可能不托管这些依赖项,与主 PyPI 存储库不同。
要解决此问题,您可以:
1。提供依赖位置:
setup( ..., install_requires=['tqdm==3.4.0', 'Jinja2==2.8'], ..., )
2。使用额外索引 URL:
pip install --extra-index-url https://testpypi.python.org/pypi poirot
此标志将 pip 定向到另外在主 PyPI 存储库中搜索 TestPyPI 上未找到的依赖项。
3.更新 PyPI 站点(对于最新的 PyPI 版本):
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple poirot
以上是为什么我的 pip 安装从 TestPyPI 失败,以及如何修复丢失的依赖项?的详细内容。更多信息请关注PHP中文网其他相关文章!