Python and pip, list all versions of a package thats available?

Python and pip, list all versions of a package thats available?

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.

(update: As of March 2020, many people have reported that yolk, installed via pip install yolk3k, only returns latest version. Chriss answer seems to have the most upvotes and worked for me)

The script at pastebin does work. However its not very convenient if youre working with multiple environments/hosts because you will have to copy/create it every time.

A better all-around solution would be to use yolk3k, which is available to install with pip. E.g. to see what versions of Django are available:

$ pip install yolk3k
$ yolk -V django
Django 1.3
Django 1.2.5
Django 1.2.4
Django 1.2.3
Django 1.2.2
Django 1.2.1
Django 1.2
Django 1.1.4
Django 1.1.3
Django 1.1.2
Django 1.0.4

yolk3k is a fork of the original yolk which ceased development in 2012. Though yolk is no longer maintained (as indicated in comments below), yolk3k appears to be and supports Python 3.

Note: I am not involved in the development of yolk3k. If something doesnt seem to work as it should, leaving a comment here should not make much difference. Use the yolk3k issue tracker instead and consider submitting a fix, if possible.

Python and pip, list all versions of a package thats available?

You dont need a third party package to get this information. pypi provides simple JSON feeds for all packages under{PKG_NAME}/json

Heres some Python code using only the standard library which gets all versions.

import json
import urllib2
from distutils.version import StrictVersion

def versions(package_name):
    url = % (package_name,)
    data = json.load(urllib2.urlopen(urllib2.Request(url)))
    versions = data[releases].keys()
    return versions

print n.join(versions(scikit-image))

That code prints (as of Feb 23rd, 2015):


Leave a Reply

Your email address will not be published. Required fields are marked *