This question already has an answer here:
Pip upgrade in virtual environment access denied
(1 answer)
Closed 4 months ago.
I'm trying to install NumPy in cmd. Numpy has been installed but a warning to upgrade the pip version appears i,e
WARNING: You are using pip version 22.0.4; however, version 22.2.2 is available.
You should consider upgrading via the 'C:\Users\test\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.
I used "upgrade pip" command but it didn't work i,e
C:\Users\test>pip install --upgrade pip
Requirement already satisfied: pip in c:\users\test\appdata\local\programs\python\python310\lib\site-packages (22.0.4)
Collecting pip
Downloading pip-22.3-py3-none-any.whl (2.1 MB)
---------------------------------------- 2.1/2.1 MB 54.0 kB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 22.0.4
Uninstalling pip-22.0.4:
Successfully uninstalled pip-22.0.4
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Users\\test\\AppData\\Local\\Temp\\pip-uninstall-lma6z9il\\pip.exe'
Consider using the `--user` option or check the permissions.
Try this command.
C:\Users\test\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip --user
Related
By doing pip install --upgrade pip I get the following:
Collecting pip
Using cached https://files.pythonhosted.org/packages/27/79/8a850fe3496446ff0d584327ae44e7500daf6764ca1a382d2d02789accf7/pip-20.3.4-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 18.1
Uninstalling pip-18.1:
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip-18.1.dist-info/INSTALLER'
Consider using the `--user` option or check the permissions.
You are using pip version 18.1, however version 20.3.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Successfully installed pip-21.0.1
WARNING: You are using pip version 20.2.1; however, version 21.0.1 is available.
Full trace
$ /usr/bin/python3 -m pip install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
Downloading pip-21.0.1-py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 19.7 MB/s
Installing collected packages: pip
WARNING: The scripts pip, pip3 and pip3.6 are installed in '/home/ubuntu/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.0.1
WARNING: You are using pip version 20.2.1; however, version 21.0.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
Despite upgrading why does it give the warning?
You don't have write permission to do the site-package upgrade re site-packages is not writeable. You can run it with sudo if you wish, although for a Debian based distribution it would be more appropriate to leave package managed files alone.
And you are not using the local version you installed re `'/home/ubuntu/.local/bin' which is not on PATH`.
To do this,
export PATH=$PATH:/home/ubuntu/.local/bin
Use sudo /usr/bin/python3 -m pip install --upgrade pip
So i really don't know what to do. I am confused. I am also using a virtual environment named PyCharm. There are many issues with pip there but I haven't seen anything as weird as this.
cmd output:
C:\Users\Artur\PycharmProjects\first\venv\Scripts>pip install time
Collecting time
Could not find a version that satisfies the requirement time (from versions: )
No matching distribution found for time
You are using pip version 10.0.1, however version 19.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Users\Artur\PycharmProjects\first\venv\Scripts>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\artur\pycharmprojects\first\venv\lib\site-packages (19.0.1)
C:\Users\Artur\PycharmProjects\first\venv\Scripts>pip install time
Collecting time
Could not find a version that satisfies the requirement time (from versions: )
No matching distribution found for time
You are using pip version 10.0.1, however version 19.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
To resolving your outdated pip in PyCharm by running this in your PyCharm terminal:
python -m pip install -U --force-reinstall pip
This will fix the warning you are receiving...You are using pip version 10.0.1, however version 19.0.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.
So I'm trying to install twillio but when I try to install it it throws this error:
MY_DEVICE_NAME:~ MY_NAME$ pip install twillio
Collecting twillio
Could not find a version that satisfies the requirement twillio (from versions: )
No matching distribution found for twillio
You are using pip version 10.0.0b2, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
MY_DEVICE_NAME:~ MY_NAME$ pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl
matplotlib 1.3.1 requires nose, which is not installed.
matplotlib 1.3.1 requires tornado, which is not installed.
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible.
Installing collected packages: pip
Found existing installation: pip 10.0.0b2
Uninstalling pip-10.0.0b2:
You are using pip version 10.0.0b2, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
After which I just get stuck in an infinite loop. so what should I do?
You made a small mistake
pip install twilio
You were trying pip install twillio
Use the following:-
pip install --upgrade pip
or
python -m pip install --upgrade pip
Somehow pip --upgrade doesn't upgrade any packages.
I'm on OSX El Capitan (10.11.3) and installed python using brew install python
Python: /usr/local/bin/python# -> ../Cellar/python/2.7.11/bin/python
Pip: /usr/local/bin/pip# -> ../Cellar/python/2.7.11/bin/pip
After successful install I run pip install --upgrade pip.
Full output:
$ pip install --upgrade pip
Collecting pip
Using cached pip-8.1.0-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-8.0.2
You are using pip version 8.0.2, however version 8.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Why doesn't pip install the new version?
Update
I think it has something to do with my ~/.pydistutils.cfg file which fixes the DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both error when running pip. I followed these instructions
Related SO question
$ sudo pip install -U pip
Collecting pip
Downloading pip-9.0.3-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 335kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Successfully installed pip-9.0.3
Getting annoyed by things not working I created a new OSX profile. In the new profile everything was working fine so after investigating further I found a file ~/Library/Application\ Support/pip/pip.conf in my main profile containing:
[global]
target=/usr/local/lib/python2.7/site-packages
I don't know how it got there but removing it resolved the issue.
This also resolved the need for the ~/.pydistutils.cfg file.