How to upgrade pip? - python

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

To upgrade pip from the command line:
python -m pip install --upgrade pip

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

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

How to upgrade pip using command prompt:
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
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

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.

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

Related

windows - pip will not update, install completes successfully but version never changes

I was tired of seeing the warning so figured I'd update pip from 21.0.1 to 21.1.2, however, when using the command D:\Python38\python.exe -m pip install --upgrade pip, or python -m pip install --upgrade pip, the version never changes to 21.1.2. I have restarted my terminal, I have checked my path, the only thing I can think is that I changed the global.cache dir to my D: drive to conserve space on my windows hog of a machine. Here is a snippet from my terminal of what I have going on.
D:\>python -V
Python 3.8.8
D:\>pip -V
pip 21.0.1 from d:\python38\lib\site-packages\pip (python 3.8)
D:\>python -m pip install --upgrade pip
Collecting pip
Using cached pip-21.1.2-py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Successfully installed pip-21.1.2
WARNING: You are using pip version 21.0.1; however, version 21.1.2 is available.
You should consider upgrading via the 'D:\Python38\python.exe -m pip install --upgrade pip' command.
D:\>pip -V
pip 21.0.1 from d:\python38\lib\site-packages\pip (python 3.8)
D:\>python -m pip install --upgrade --no-cache pip
Collecting pip
Downloading pip-21.1.2-py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 939 kB/s
Installing collected packages: pip
Successfully installed pip-21.1.2
WARNING: You are using pip version 21.0.1; however, version 21.1.2 is available.
You should consider upgrading via the 'D:\Python38\python.exe -m pip install --upgrade pip' command.
D:\>pip -V
pip 21.0.1 from d:\python38\lib\site-packages\pip (python 3.8)
my pip config debug info:
D:\>pip config debug
env_var:
env:
global:
C:\ProgramData\pip\pip.ini, exists: False
site:
d:\python38\pip.ini, exists: False
user:
C:\Users\logan\pip\pip.ini, exists: False
C:\Users\logan\AppData\Roaming\pip\pip.ini, exists: True
global.target: D:\Git\pip\site-packages
global.cache: D:\Git\pip\cache
global.pip-cache-dir: D:\Git\pip\cache
I have scoured the internet for an inkling into why this is happening but I can't seem to find an answer. Thing is, this isn't something that I have to have done, it's just nagging at me that I cant figure it out at this point.
I have read through the pip documentation config file and user guide and of course I have looked for my answer here before asking my question, I hope someone out there can give me some insight and thank you for your time.

Problem downloading (pytube) library in Python

I want to download a library from Python libraries called (pytube)
When I place the download command [pip install git + https: //github.com/pytube/pytube] in the cmd panel, the following output will come out:
Collecting git+https://github.com/pytube/pytube
Cloning https://github.com/pytube/pytube to c:\users\jit\appdata\local\temp\pip-req-build-w3q3fwqn
Requirement already satisfied (use --upgrade to upgrade): pytube==10.6.1 from git+https://github.com/pytube/pytube in c:\users\jit\appdata\local\programs\python\python39\lib\site-packages
Using legacy 'setup.py install' for pytube, since package 'wheel' is not installed.
WARNING: You are using pip version 20.2.3; however, version 21.0.1 is available.
You should consider upgrading via the 'c:\users\jit\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.
So I write what prompts [pip install --upgrade pip] into the cmd panel, and it gets the following output:
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.3
Uninstalling pip-20.2.3:
Successfully uninstalled pip-20.2.3
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Users\\jit\\AppData\\Local\\Temp\\pip-uninstall-pnqylmmj\\pip.exe'
Consider using the `--user` option or check the permissions.
Illustrative image :
https://suar.me/ve9J0
And in another attempt to install it, I typed the command in the (Terminal) inside the (PyCharm) program:
Collecting git+https://github.com/pytube/pytube
Cloning https://github.com/pytube/pytube to c:\users\jit\appdata\local\temp\pip-req-build-o5uke_cl
Running command git clone -q https://github.com/pytube/pytube 'C:\Users\jit\AppData\Local\Temp\pip-req-build-o5uke_cl'
Illustrative image :
https://suar.me/OZYPG
And I did not succeed in installing the library! Why is that? How do I get to the solution?
Try installing pytube3. pip install pytube3
for the pip warning it's just a warning because you are not using the latest version , use this command to upgrade it: python -m pip install --upgrade pip
Welcome to Stackoverflow!!!
For pytube as you already installed, try upgrade to latest version pytube-10.6.1:
python -m pip install --upgrade pytube
For pip install --upgrade pip error, this is happening due to insufficient access:
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Users\\jit\\AppData\\Local\\Temp\\pip-uninstall-pnqylmmj\\pip.exe'
Solution:
Consider using the `--user` option or check the permissions.
Try:
python -m pip install --upgrade pip --user
Or open the command prompt as administrator and execute the same command.

How to update pip to latest version 20.0.2

While using this command
"python -m pip install --upgrade pip"
I get this error message:
"Collecting pip
Using cached https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\program files (x86)\\python38-32\\lib\\site-packages\\pip-19.2.3.dist-info\\entry_points.txt'
Consider using the `--user` option or check the permissions.
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command."
What's the solution to this?
I'm not too sure what the error could be, but I suspect the problem is that you are not running your terminal/command prompt as an administrator. So when you are launching your terminal/command prompt just right-click and run as administrator
Or you could try using a different method of updating pip,
pip install --upgrade pip
Can you try with this command instead ? Also if any issue persists try running cmd as Administrator
python -m pip install --user --upgrade pip

pip install -U setuptools fail windows 10

I just installed Python3.7 and Pycharm on my Windows 10 PC.
I am running pip version 9.0.2
In Pycharm, it says I have version 28.8.0 of setuptools, when I try to upgrade this in Pycharm, which I believe runs the line
pip install -U setuptools
I get the error:
PermissionError: [WinError 32] The process cannot access the file because it
is being used by another process:
'c:\users\Username\pycharmprojects\untitled1\venv\lib\site-
packages\setuptools-28.8.0-py3.6.egg' ->
'C:\Users\Username\AppData\Local\Temp\pip-i5jxitem-
uninstall\users\Username\pycharmprojects\untitled1\venv\lib\site-
packages\setuptools-28.8.0-py3.6.egg'
I have tried running
pip install --upgrade setuptools
which runs successfully and says I have the latest version.
Does anyone know how I can successfully update setuptools?
The reason I'd like setuptools to be up to date, is so I can then get rid of the egg_info error installing other packages.
I have the same error. Not sure why it happened. But I managed to upgrade by running:
pip install setuptools --upgrade --ignore-installed
You can also try:
easy_install --upgrade setuptools
Even though easy_install's deprecated, there's a good chance it'll still work on Windows.
If you try to use pip to upgrade setuptools:
pip install -U setuptools
it seems to get stuck on an error about 10.0 vs 18.0 "You should consider upgrading via the 'python -m pip install --upgrade pip' command."
The official pip doco(https://pip.pypa.io/en/stable/installing/#upgrading-pip) says on Windows to use this:
python -m pip install --upgrade pip
However, it seemed pip and setuptools had a hiccup with a circular dependency or lock around pip-v9.0 or 10.0 to pip-18.0 and setuptools v28.0 to v39.0 or 40.0 so persevere with this:
python -m pip install --force-reinstall pip
You need setuptools >= 39.0 if you want to install pipenv also.
Try the following command to upgrade the setup tools in windows
pip install -U pip setuptools
or
pip install setuptools --upgrade --ignore-installed
I solved more or less similar problem as follow:
In my PyCharm project terminal tab:
`(venv) PS C:/path/to/project>`
updated pip, setup tools and wheels with command:
py -m pip install --upgrade pip setuptools wheel
(source of recommendation)

Pip updates but installs old version

$ pip install -U pip
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-8.1.1
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The problem is pretty self-explanatory.
I tell pip to update itself, it gets the 9.0.1 package, installs 8.1.1 somehow then tells me to run the command i just ran to update it.
I managed to fix it by installing pip trough the script given at the website(apt-get installs version 8.1.1):
https://bootstrap.pypa.io/get-pip.py
It automatically uninstalled the old version so everything is in order now.

Categories

Resources