Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python

pip

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.

like image 563
Amandasaurus Avatar asked Feb 03 '11 15:02

Amandasaurus


People also ask

How do I list all pip packages?

To do so, we can use the pip list -o or pip list --outdated command, which returns a list of packages with the version currently installed and the latest available. On the other hand, to list out all the packages that are up to date, we can use the pip list -u or pip list --uptodate command.

How can I tell what version of pip package I have?

To check which version of a given package is installed, use the pip show <your_package> command. For example, to check the version of your NumPy installation or virtual environment, run pip show numpy in your command line or Powershell (Windows), or terminal (macOS and Linux/Ubuntu).

How do I see what Python modules are available?

To check all the installed Python modules, we can use the following two commands with the 'pip': Using 'pip freeze' command. Using 'pip list command.

What is pip list in Python?

If you want to list all the Python packages installed in an environment, pip list command is what you are looking for. $ python3 -m pip list. The command will return all the packages installed, along with their specific version and location.


1 Answers

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.

like image 112
Chris Montanaro Avatar answered Sep 21 '22 11:09

Chris Montanaro