5

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?

abinitio
  • 609
  • 6
  • 20
  • Does pip throw any other errors, such as failing to reach the target server? Can you directly install from the ``requirements.txt``, or do you have to install each individually? For the test on your own machine, do you use a fresh env without access to the system python libraries? – MisterMiyagi Jul 30 '18 at 08:20
  • try using pip `-r` install – Kishor Pawar Jul 30 '18 at 08:30

1 Answers1

15

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
Nils Werner
  • 34,832
  • 7
  • 76
  • 98