Using pip, is it possible to figure out which version of a package is currently installed?
I know about pip install XYZ --upgrade
but I am wondering if
In question, it is not mentioned which OS user is using (Windows/Linux/Mac)
As there are couple of answers which will work flawlessly on Mac and Linux.
Below command can be used in case the user is trying to find the version of a python package on windows.
In PowerShell use below command :
pip list | findstr <PackageName>
Example:- pip list | findstr requests
Output : requests 2.18.4
For Windows you can
open cmd and type python, press enter.
type the import and press enter.
type ._version__ and press enter.
As you can see in screen shot here I am using this method for checking the version of serial module.
pip show works in python 3.7:
pip show selenium
Name: selenium
Version: 4.0.0a3
Summary: Python bindings for Selenium
Home-page: https://github.com/SeleniumHQ/selenium/
Author: UNKNOWN
Author-email: UNKNOWN
License: Apache 2.0
Location: c:\python3.7\lib\site-packages\selenium-4.0.0a3-py3.7.egg
Requires: urllib3
Required-by:
There's also a tool called pip-check
which gives you a quick overview of all installed packages and their update status:
Haven't used it myself; just stumbled upon it and this SO question in quick succession, and since it wasn't mentioned...
I just sent a pull request in pip with the enhancement Hugo Tavares said:
(specloud as example)
$ pip show specloud
Package: specloud
Version: 0.4.4
Requires:
nose
figleaf
pinocchio
On windows, you can issue command such as:
pip show setuptools | findstr "Version"
Output:
Version: 34.1.1