Python and pip, list all versions of a package that's available?
(update: As of March 2020, many people have reported that yolk, installed via pip install yolk3k
, only returns latest version. Chris's answer seems to have the most upvotes and worked for me)
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 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 doesn't 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.
check version of pip packages available before installing
For newer versions of pip as of Dec 2020, you should use:
pip download -v packagename
For older versions of pip you can use:
pip install --download . -v packagename
Both above commands will download the files without installing and will also show all the version of a package (you can stop the command after that). After that, to install a specific version use:
pip install packagename==version
How to see available pypi package versions with pip 20.3?
add to your ~/.bashrc
function pipver() { curl -s https://pypi.org/rss/project/$1/releases.xml | sed -n 's/\s*<title>\([0-9.]*\).*/\1/p' ;}
Then open a new terminal window and invoke, using: pipver numpy
substituting whichever module you're looking for version info on.
1.19.4
1.19.3
1.19.2
1.19.1
etc...
It gathers the relevant .rss XML with curl
, then pipes that through sed
the stream-editor, selecting lines that match <title>[version.numbers]
then only printing out those captured version numbers for you.
Find which version of package is installed with pip
As of pip 1.3, there is a pip show
command.
$ pip show Jinja2
---
Name: Jinja2
Version: 2.7.3
Location: /path/to/virtualenv/lib/python2.7/site-packages
Requires: markupsafe
In older versions, pip freeze
and grep
should do the job nicely.
$ pip freeze | grep Jinja2
Jinja2==2.7.3
Full list of all packages available through pip install command?
You can find a full list here:
https://pypi.org/simple/
This will take a while to load though. As for pip
itself, there is pip search <term>
, but no full listing of packages available from a repository.
Also see pip documentation here.
As came up in comments on the question:
is there a central repository? Or is anyone completely free to add
packages as they please?
Finding packages in the pip
documentation.
Get list of all available pip packages and their versions
See PyPI Simple API on how to get the list of all available packages without versions.
How do I search for an available Python package using pip?
To search for a package, issue the command
pip search [package-name]
Related Topics
Programmatically Saving Image to Django Imagefield
Relative Imports - Modulenotfounderror: No Module Named X
Ignore Python Multiple Return Value
Replacing Column Values in a Pandas Dataframe
Django Passing Custom Form Parameters to Formset
How to Uninstall Anaconda Completely from MACos
How to Get a Random Number Between a Float Range
Argument 1 Has Unexpected Type 'Nonetype'
How to Add Both File and JSON Body in a Fastapi Post Request
Any Way to Modify Locals Dictionary
Tensorflow Only Running on 1/32 of the Training Data Provided
What Are the Most Common Python Docstring Formats
What Does -1 Mean in Numpy Reshape
How to Create Multiline Comments in Python
How to Print an Exception in Python
How to Create Test and Train Samples from One Dataframe with Pandas