Given the name of a Python (2.X) package that can be installed with pip and virtualenv, 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.
https://pypi.python.org/pypi/Django/ - works for packages whose maintainers choose to show all packages https://pypi.python.org/simple/pip/ - should do the trick anyhow (lists all links)
The script at pastebin does work. However it's not very convenient if you're working with multiple environments/hosts because you will have to copy/create it every time.
A better all-around solution would be to use yolk, which is available to install with pip. E.g. to see what versions of Django are available:
A minor caveat: yolk depends on distribute. This is not a bad thing, but it may be a problem if you need for some reason to stick with (the deprecated) python setuptools.
Note: I am not involved in the development of yolk. If something doesn't seem to work as it should, leaving a comment here should not make much difference. Use the yolk issue tracker instead and consider submitting a fix, if possible.
I just ran this:
e.g.:
I came up with dead-simple bash script. Thanks to jq's author.
This works for me on OSX:
pip install docker-compose== 2>&1 | grep -oE '(\(.*\))' | awk -F:\ '{print$NF}' | sed -E 's/( |\))//g' | tr ',' '\n'
It returns the list one per line:
Or to get the latest version available:
pip install docker-compose== 2>&1 | grep -oE '(\(.*\))' | awk -F:\ '{print$NF}' | sed -E 's/( |\))//g' | tr ',' '\n' | gsort -r -V | head -1
Keep in mind
gsort
has to be installed (on OSX) to parse the versions. You can install it withbrew install coreutils
Update:
As of Sep 2017 this method no longer works:
--no-install
was removed in pip 7Use
pip install -v
, you can see all versions that availableTo not install any package, use one of following solution:
or
Tested with pip 1.0