Is there a pip
command that will determine whether the latest version of a package is installed?
I am writing a shell script that needs to determine if the latest version is installed. If not, then my script needs to manually install the package. (It's PIL if anyone's curious and needs to be installed manually because the headers and libraries for libjpeg
are in a non-standard location.)
This answer describes how to retrieve the version of the package currently installed, but I would also need the latest version available for download and some way to compare versions.
A more useful command might be pip list -o
which gives you a list of your out-dated libraries.
$ pip list -o
dj-database-url (0.3.0) - Latest: 0.4.0 [sdist]
...
You could do something like:
$ pip list -o | grep PIL
And see if it returns any output.
'pip search' gives you that information. e.g.:
$ pip search SOAPpy
SOAPpy - SOAP Services for Python
INSTALLED: 0.12.0
LATEST: 0.12.5
versus:
$ pip search MarkupSafe
MarkupSafe - Implements a XML/HTML/XHTML Markup safe string for Python
INSTALLED: 0.19 (latest)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With