pip install产生“找不到满足要求的版本"; [英] pip install producing "Could not find a version that satisfies the requirement"

查看:950
本文介绍了pip install产生“找不到满足要求的版本";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a package that i have uploaded to test.pypi.

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

I can install this package in a virtual environment on my machine without any issues using

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

"requirements.txt"文件中有该软件包的要求列表,这些要求也包含在setup.py中提供给setup的配置字典中的"install_requires"中.

There is a list of requirements for the package in a 'requirements.txt' file, which are also included in 'install_requires' in the config dict fed to setup in setup.py.

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

This works fine on my machine. When I try the same process within a clean virtual environment on one of my groups local servers i get the following error:

  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文件中的许多需求.

for many of the requirements in the requirements.txt file.

但是如果安装失败,

pip install widgetsnbextension

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

pip finds and installs widgetsnbextension-3.2.1 without any problem.

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

The requirements.txt file was made by using pip freeze, so I am confused as to why it will work without the version number, but not with it.

任何人都可以解释我在做什么错吗?

Can anyone explain what I am doing wrong please?

推荐答案

如果使用--index-urlpip将不再从适当的PyPI"安装,而仅从"test PyPI"安装.相反,如果您使用--extra-index-url,它将同时从以下两个位置安装:

If you use --index-url pip will no longer install from "proper PyPI", but only from "test PyPI". If instead you use --extra-index-url, it will install from both:

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

这篇关于pip install产生“找不到满足要求的版本";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆