155

Which shell command gives me the actual version of pip I am using?

pip gives with pip show all version of modules that are installed but excludes itself.

nbro
  • 15,395
  • 32
  • 113
  • 196
doniyor
  • 36,596
  • 57
  • 175
  • 260
  • 5
    @doniyor: and `pip -h` would have told you about the option.. – Martijn Pieters Oct 15 '14 at 09:01
  • 9
    The reason this is upvoted so much is because the `-version` flag is found between the `--isolated` flag and `--proxy` flags, that is where the user scans, and the eyes start glazing over. It's a bad design to put extremely common command hidden between stuff that looks like the developer of pip accidentally piped random internet jargon to screen and then thought: "oh yeah, now I'll talk about basic usage". This is a common theme in python, where python is less a pre-packaged system and more a trashbag of tools dumped on the floor. – Eric Leschinski Feb 10 '16 at 20:24
  • 2
    Doing `python.exe -m pip show pip` works as of now with pip-20.1.1 and Python 3.7.5 though. – mlvljr Jun 06 '20 at 14:11

13 Answers13

222

You can do this:

pip -V

or:

pip --version
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
Bowersbros
  • 3,438
  • 2
  • 18
  • 24
  • 7
    For windows users: python -m pip --version – Pedro77 Oct 28 '19 at 14:00
  • 2
    Both `pip -V` and `pip --version` work for me on Win10 – Julian Jan 08 '21 at 12:02
  • 2
    pip3 --version for python3 – Arjjun Sep 03 '21 at 00:43
  • Just to add that if the above doesn't work, try pip3 -V FOR Python 3 – Duru Cynthia Udoka Nov 08 '21 at 00:53
  • A quiz question 's answer on PythonInstitute-Edube platform says that `pip --version` , `pip -version`, `pip version` can be used to determine pip version.I checked the codes on my windows pc' s cmd, and then only `pip --version` worked. Is the answer false ? Or am I missing anything else? – ACrescendo Jul 26 '22 at 23:28
  • Both of these give me `ImportError: cannot import name 'FormatControl'` similar to [this](https://stackoverflow.com/questions/67464298/how-to-fix-importerror-cannot-import-name-formatcontrol-for-pip#comment132512749_68943800). Simply running `pip` does too. But I do have `pip`: ` load_entry_point('pip==10.0.1', 'console_scripts', 'pip3.6')()` and `which pip` gives me `/usr/bin/pip` – Nike Jan 12 '23 at 01:47
21

Just for completeness:

pip -V

pip --version

pip list and inside the list you'll find also pip with its version.

Alberto Coletta
  • 1,563
  • 2
  • 15
  • 24
17

For windows just type:

python -m pip --version
absawd_4om
  • 181
  • 1
  • 3
16

For windows:

import pip

help(pip) 

shows the version at the end of the help file.

nbro
  • 15,395
  • 32
  • 113
  • 196
gxpr
  • 836
  • 9
  • 12
11

Any of the following should work

pip --version
# pip 19.0.3 from /usr/local/lib/python2.7/site-packages/pip (python 2.7)

or

pip -V       
# pip 19.0.3 from /usr/local/lib/python2.7/site-packages/pip (python 2.7)

or

pip3 -V      
# pip 19.0.3 from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)
Gepeto97
  • 173
  • 2
  • 12
7

check two things

pip2 --version   

and

pip3 --version

because the default pip may be anyone of this so it is always better to check both.

Gepeto97
  • 173
  • 2
  • 12
Adarsh97
  • 71
  • 1
  • 4
7

Many people use both 2.X and 3.X python. You can use pip -V to show default pip version.
If you have many python versions, and you want to install some packages through different pip, I advise this way:

sudo python2.X -m pip install some-package==0.16
Mel
  • 5,837
  • 10
  • 37
  • 42
ellie
  • 133
  • 1
  • 5
7

Start Python and type import pip pip.__version__ which works for all python packages.

Luk-StackOverflow
  • 321
  • 1
  • 5
  • 10
6

On RHEL "pip -V" works :

$ pip -V
pip 6.1.1 from /usr/lib/python2.6/site-packages (python 2.6)
Don_Manj
  • 131
  • 1
  • 7
3

First, open a command prompt After type a bellow commands.

check a version itself Easily :

Form Windows:

pip installation :

pip install pip

pip Version check:

pip --version 
Manideep
  • 353
  • 3
  • 13
3

For Windows machine go to command prompt and type.

pip -V 
Avijit Das
  • 133
  • 10
3
`pip -v` or `pip --v` 

However note, if you are using macos catelina which has the zsh (z shell) it might give you a whole bunch of things, so the best option is to try install the version or start as -- pip3

Nikhil Fadnis
  • 787
  • 5
  • 14
Samuel Kamau
  • 149
  • 2
  • 4
0

py -m pip --version

This worked for python version 3.9.7

Zeus
  • 1,496
  • 2
  • 24
  • 53