24

I want to install tensorflow, but I need to upgrade pip. How to upgrade pip? I tried to upgrade through the command line and this is what I got.

C:\Users\garoo>python -m pip install --upgrade pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 10.0.1
    Uninstalling pip-10.0.1:
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\program files (x86)\\python36-32\\lib\\site-packages\\pip-10.0.1.dist-info\\entry_points.txt'
Consider using the `--user` option or check the permissions.

You are using pip version 10.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\garoo>python -m pip install --upgrade pip
Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
James Robinson
  • 241
  • 1
  • 3
  • 7

7 Answers7

33

To upgrade pip from the command line:

python -m pip install --upgrade pip
Iain Hunter
  • 4,319
  • 1
  • 27
  • 13
10

You do not need to upgrade pip to install tensorflow. Although if you still wish to do so you can try this

pip install --user --upgrade pip

Else try running the CMD as Admin

Aaron Pereira
  • 314
  • 1
  • 2
  • 10
0

For permission error while installing Python dependencies, you need to run the terminal or command prompt or powershell as administrator

Example below:

enter image description here

Jeril
  • 7,858
  • 3
  • 52
  • 69
0

How to upgrade pip using command prompt:

  1. Open the command prompt from the Start Menu

    • Click the lower-left Start button to open the Start Menu
    • input cmd in the empty box and tap Command Prompt in the results
  2. Use python -m pip install --upgrade pip to uninstall the old pip package and install the current version.

Collecting pip
  Downloading pip-22.0.4-py3-none-any.whl (2.1 MB)
     ---------------------------------------- 2.1/2.1 MB 284.1 kB/s eta 0:00:00
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 22.0.3
    Uninstalling pip-22.0.3:
      Successfully uninstalled pip-22.0.3
Successfully installed pip-22.0.4
Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
dataninsight
  • 1,069
  • 6
  • 13
0

Adding up to @Iain Hunter's answer, if the command prompt provides you with an error:

'python' is not recognized as an internal or external command,

operable program or batch file.

Try changing python -m pip install --upgrade pip to py -m pip install --upgrade pip. If cmd still provides you the error, try downloading Python once again; Maybe you accidentally unchecked the download pip box while downloading Python.

0

It might help someone:

import subprocess
subprocess.run(['pip','install','--upgrade','pip'])
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
TomSa
  • 1
-6
m pip install --upgrade pip 

Write this clause on terminal and press Enter m pip install --upgrade pip