Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find which version of package is installed with pip

Tags:

python

pip

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 there is anything like pip info XYZ. If not what would be the best way to tell what version I am currently using.

like image 252
Alexis Avatar asked Apr 18 '12 17:04

Alexis


People also ask

How do you check the version of a Python package installed?

Check Package Version Python To check which version of a given Python package is installed, use pip show my_package . For example, to check the version of your NumPy installation, run pip show numpy in your CMD/Powershell (Windows), or terminal (macOS/Linux/Ubuntu).

Does pip install the latest version of package?

txt file, pip looks for the latest version that satisfies the requirement and installs it. Next, you can upgrade the packages in your requirements file by running the install command with the --upgrade switch or the -U shorthand: Windows. Linux + macOS.


1 Answers

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 
like image 156
2 revs Avatar answered Oct 01 '22 06:10

2 revs