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.

On windows, pip install -U pip fails if TEMP is on different drive letter.

See original GitHub issue
> pip install -U pip
You are using pip version 7.0.3, however version 7.1.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Collecting pip
  Downloading pip-7.1.0-py2.py3-none-any.whl (1.1MB)
    100% |################################| 1.1MB 120kB/s
Installing collected packages: pip
  Found existing installation: pip 7.0.3
    Uninstalling pip-7.0.3:
Exception:
Traceback (most recent call last):
  File "C:\Develop\Python34\lib\shutil.py", line 522, in move
    os.rename(src, real_dst)
OSError: [WinError 17] The system cannot move the file to a different disk drive: 'c:\\develop\\python34\\scripts\\pip.exe' -> 'D:\\TEMP\\pip-ugv4c2uf-uninstall\\develop\\python34\\scripts\\pip.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Develop\Python34\lib\site-packages\pip\basecommand.py", line 223, in main
  File "C:\Develop\Python34\lib\site-packages\pip\commands\install.py", line 297, in run
  File "C:\Develop\Python34\lib\site-packages\pip\req\req_set.py", line 616, in install
  File "C:\Develop\Python34\lib\site-packages\pip\req\req_install.py", line 721, in uninstall
  File "C:\Develop\Python34\lib\site-packages\pip\req\req_uninstall.py", line 126, in remove
  File "C:\Develop\Python34\lib\site-packages\pip\utils\__init__.py", line 314, in renames
  File "C:\Develop\Python34\lib\shutil.py", line 535, in move
    os.unlink(src)
PermissionError: [WinError 5] Access is denied: 'c:\\develop\\python34\\scripts\\pip.exe'

The workaround python -m pip install -U pip is still useful.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
leopardyaocommented, Jan 17, 2018

I am sorry but what is the solution? I am still having the same issue when run “pip uninstall some-package”. thanks for instructions. windows 10.
anaconda3-4.4.0 (Pip version is 9.0.1) python 3.6.2

1reaction
shimizukawacommented, May 2, 2018

On changelog,

10.0.0b1 (2018-03-31) Display a message to run the right command for modifying pip on Windows (#4490)

by the change, this issue has resolved. I got a bellow message:

(venv) > pip install -U pip
ERROR: To modify pip, please run the following command:
c:\venv\scripts\python.exe -m pip install -U pip

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install a Python package into a different directory using pip?
Now question number two: when you're already installing into a custom directory, how to make pip NOT try to remove and older version...
Read more >
Using Python's pip to Manage Your Projects' Dependencies
Reinstalling pip When Errors Occur. When you run the pip command, you may get an error in some cases. Your specific error message...
Read more >
Robot Framework User Guide
1.1 Introduction. Robot Framework is a Python-based, extensible keyword-driven automation framework for acceptance testing, acceptance test driven ...
Read more >
i am installing wordcloud using pip but i am unable to do that i ...
Running setup.py install for wordcloud ... error ERROR: Command errored out with exit status 1: command: 'c:\python38\python.exe' -u -c ...
Read more >
python access network drive with password - il nostro amico vet
The syntax of pip install is as follows: pip install . If you prefer to use a specific driver letter, replace * with...
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