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

孤人 提交于 2019-12-11 00:45:21

问题


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

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)

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

However when the install bails, if i do:

pip install widgetsnbextension

pip finds and installs widgetsnbextension-3.2.1 without any problem.

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?


回答1:


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


来源:https://stackoverflow.com/questions/51589673/pip-install-producing-could-not-find-a-version-that-satisfies-the-requirement

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!