Python and pip, list all versions of a package that’s available

pippython

Given the name of a Python package that can be installed with pip, is there any way to find out a list of all the possible versions of it that pip could install? Right now it's trial and error.

I'm trying to install a version for a third party library, but the newest version is too new, there were backwards incompatible changes made. So I'd like to somehow have a list of all the versions that pip knows about, so that I can test them.

Best Answer

For pip >= 21.2 use:

pip index versions pylibmc

Note that this command is experimental, and might change in the future!

For pip >= 21.1 use:

pip install pylibmc==

For pip >= 20.3 use:

pip install --use-deprecated=legacy-resolver pylibmc==

For pip >= 9.0 use:

$ pip install pylibmc==
Collecting pylibmc==
  Could not find a version that satisfies the requirement pylibmc== (from 
  versions: 0.2, 0.3, 0.4, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5, 0.5, 0.6.1, 0.6, 
  0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7, 0.8.1, 0.8.2, 0.8, 0.9.1, 0.9.2, 0.9, 
  1.0-alpha, 1.0-beta, 1.0, 1.1.1, 1.1, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.3.0)
No matching distribution found for pylibmc==

The available versions will be printed without actually downloading or installing any packages.

For pip < 9.0 use:

pip install pylibmc==blork

where blork can be any string that is not a valid version number.