question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip upgrade fails due to permissions error, then claims it didn't fail

See original GitHub issue

Environment

  • 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

  1. Run pip install --upgrade pip. See error.
  2. 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JordonMMGcommented, Nov 19, 2019

Issue still exists:

image

0reactions
no-response[bot]commented, Dec 23, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PIP Upgrade Permission Denied Windows 10 - Stack Overflow
Try to open your Command Prompt or Powershell by clicking "Run as administrator". You can find the steps in this video.
Read more >
Error while upgrading pip ERROR Could not install packages ...
1: Successfully uninstalled pip-19.1.1 ERROR: Could not install packages due to an EnvironmentError: [Error 5] Access is denied: 'c:\\users\\ ...
Read more >
Permission denied when running "pip install"
Symptom. When attempting to install or upgrade packages using "pip install", you receive a permission denied error. For example:.
Read more >
Troubleshooting AWS CLI errors - AWS Command Line Interface
Access denied errors ... On Linux or macOS, make sure that the aws program has run permissions for the calling user. Typically, the...
Read more >
Package installation issues | PyCharm Documentation
You might encounter a problem when installing a Python package in the project settings or in the Python Package tool window. Eventually, most...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found