pip upgrade fails due to permissions error, then claims it didn't fail
See original GitHub issueEnvironment
- pip version: 19.0.3 (or is it?..read below)
- Python version: 3.7.4 x86 or x64
- OS: Win 10 Pro x64 Version 10.0.18362 Build 18362
Description Upgrading pip reports that it fails due to a permissions error, then re-running the upgrade reports that it was already installed.
Expected behavior Either fail and complain or install and don’t complain.
How to Reproduce
- Run
pip install --upgrade pip
. See error. - Run
pip install --upgrade pip
a second time. Claims it was already installed.
Output
First upgrade fails:
C:\Users\rjamd>pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/8d/07/f7d7ced2f97ca3098c16565efbe6b15fafcba53e8d9bdb431e09140514b0/pip-19.2.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.0.3
Uninstalling pip-19.0.3:
Successfully uninstalled pip-19.0.3
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Users\\rjamd\\AppData\\Local\\Temp\\pip-uninstall-3x5sa0o8\\pip.exe'
Consider using the `--user` option or check the permissions.
Second upgrade claims it didn’t fail the first time:
C:\Users\rjamd>pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\rjamd\appdata\local\programs\python\python37\lib\site-packages (19.2.2)
C:\Users\rjamd>pip -V
pip 19.2.2 from c:\users\rjamd\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7)
The site-packages folder does not contain an exe called pip.exe
but does contain a folder called pip
, and another folder called pip-19.2.2.dist-info
This is where all the python’s exe’s are:
C:\Users\rjamd>where python
C:\Users\rjamd\AppData\Local\Programs\Python\Python37\python.exe
C:\Users\rjamd\AppData\Local\Programs\Python\Python37-32\python.exe
C:\Users\rjamd\AppData\Local\Microsoft\WindowsApps\python.exe
I checked the Temp folder and pip exists in it, but why would it have trouble deleting its own temp folder? I couldn’t get any version info from the exe metadata, so I directly ran it in CMD and found out literally nothing, because it reports the version from a different directory, weirdly enough:
C:\Users\rjamd>C:\Users\rjamd\AppData\Local\Temp\pip-uninstall-3x5sa0o8\pip -V
pip 19.2.2 from c:\users\rjamd\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Issue still exists:
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don’t have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.