72

This is the package I'm interested in:

Django filebrowser no Grappelli

However, the latest version no longer supports Django 1.3. I need to find a version that does. How do I see a list of older versions?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Marijus
  • 4,195
  • 15
  • 52
  • 87

6 Answers6

85

It's perhaps a little inelegant, but it appears that you can go to the URL

https://pypi.python.org/simple/<package>

And you will get a bunch of links to tarballs for the package.

Ex:

https://pypi.python.org/simple/django-filebrowser-no-grappelli/
limp_chimp
  • 13,475
  • 17
  • 66
  • 105
38

This is visible in the new UI for pypi:

https://pypi.org/project/<package>/#history

For example:

https://pypi.org/project/django-filebrowser-no-grappelli/#history
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
ngoldbaum
  • 5,430
  • 3
  • 28
  • 35
13

You can use this short Python 3 script to grab the list of available versions for a package from PyPI using JSON API:

#!/usr/bin/env python3

import sys    
import requests
from pkg_resources import parse_version    

def versions(pkg_name):
    url = f'https://pypi.python.org/pypi/{pkg_name}/json'
    releases = requests.get(url).json()['releases']
    return sorted(releases, key=parse_version, reverse=True)    

if __name__ == '__main__':
    print(*versions(sys.argv[1]), sep='\n')

Demo:

$ python versions.py django-filebrowser-no-grappelli
3.7.8
3.7.7
3.7.6
3.7.5
3.7.4
3.7.3
3.7.2
3.7.1
3.7.0
3.6.2
3.6.1
3.5.8
3.5.7
3.5.6
3.1.1
Eugene Yarmash
  • 142,882
  • 41
  • 325
  • 378
8

Using pip you can find out all the available versions of that package:

pip install django-filebrowser-no-grappelli==randomwords

This will produce an output of all the available packages:

Could not find a version that satisfies the requirement
  django-filebrowser-no-grappelli==randomwords
(from versions: 3.1.1, 3.5.6, 3.5.7, 3.5.8, 3.6.1, 3.6.2, 3.7.0, 3.7.1, 3.7.2)
   No matching distribution found for
   django-filebrowser-no-grappelli==randomwords

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Twengg Rich
  • 311
  • 3
  • 3
  • 1
    This is the best by now for me, raised bounty for this. However, I still see it as a workaround, `pip` should have a clear option to list all available versions. – user.dz Nov 09 '17 at 12:59
4

Store the following code in the get_version.py file:

import json
import sys
import urllib2

from distutils.version import LooseVersion

name = sys.argv[1]

resp = urllib2.urlopen("https://pypi.python.org/pypi/{}/json".format(name))
data = json.load(resp)

for ver in sorted([LooseVersion(version) for version in data["releases"].keys()]):
    print ver.vstring

Run it to get a sorted list of all package versions:

python get_version.py %PACKAGE-NAME%
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Archibald
  • 1,305
  • 1
  • 14
  • 19
3

If you are using pip to install your package, then you may use:

pip install yolk
yolk -V django-filebrowser-no-grappelli

Unfortunately the only available version seems to be:

django-filebrowser-no-grappelli 3.1.1

However, you can try to find another version on the Internet and install by:

pip install -Iv <url_package>
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
redcrow
  • 1,743
  • 3
  • 25
  • 45