繁体   English   中英

pip install产生“找不到满足要求的版本”

[英]pip install producing “Could not find a version that satisfies the requirement”

我有一个已上传到test.pypi的软件包。

我可以使用计算机在虚拟环境中安装此软件包,而不会出现任何问题

pip install --index-url https://test.pypi.org/simple/ package_name_here

在“ requirements.txt”文件中有该软件包的要求列表,这些要求也包含在setup.py中提供给setup的config dict的“ install_requires”中。

这在我的机器上工作正常。 当我在一组本地服务器上的干净虚拟环境中尝试相同的过程时,出现以下错误:

  Could not find a version that satisfies the requirement widgetsnbextension>=3.2.1 (from package_name_here) (from versions: )
No matching distribution found for widgetsnbextension>=3.2.1 (from package_name_here)

适用于requirements.txt文件中的许多需求。

但是,当安装失败时,如果我这样做:

pip install widgetsnbextension

pip可以毫无问题地找到并安装小部件nbextension-3.2.1。

requirements.txt文件是通过使用pip冻结制作的,因此我对为什么没有版本号但不能使用版本号的情况感到困惑。

谁能解释我做错了吗?

如果您使用--index-url pip将不再从“适当的PyPI”安装,而是仅从“ test PyPI”安装。 相反,如果您使用--extra-index-url ,它将从以下两者安装:

pip install --extra-index-url https://test.pypi.org/simple/ package_name_here

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM