[New-bugs-announce] [issue33285] pip upgrade runtime crash

Bram Borger-Johnson report at bugs.python.org
Sun Apr 15 17:47:49 EDT 2018

New submission from Bram Borger-Johnson <Bramnet at live.com>:

I was using pip to install a package when I got a warning message that a new version of pip was available.
I ran the prompted command and got the following back.
E:\GitHub\discord_feedbot>pip install --upgrade pip
Collecting pip
  Downloading pip-10.0.0-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 654kB/s
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
Traceback (most recent call last):
  File "e:\programs\python36-32\lib\shutil.py", line 544, in move
    os.rename(src, real_dst)
OSError: [WinError 17] The system cannot move the file to a different disk drive: 'e:\\programs\\python36-32\\scripts\\pip.exe' -> 'C:\\Users\\Bram\\AppData\\Local\\Temp\\pip-nahcxphl-uninstall\\programs\\python36-32\\scripts\\pip.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "e:\programs\python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
  File "e:\programs\python36-32\lib\site-packages\pip\commands\install.py", line 342, in run
  File "e:\programs\python36-32\lib\site-packages\pip\req\req_set.py", line 778, in install
  File "e:\programs\python36-32\lib\site-packages\pip\req\req_install.py", line 754, in uninstall
  File "e:\programs\python36-32\lib\site-packages\pip\req\req_uninstall.py", line 115, in remove
  File "e:\programs\python36-32\lib\site-packages\pip\utils\__init__.py", line 267, in renames
  File "e:\programs\python36-32\lib\shutil.py", line 559, in move
PermissionError: [WinError 5] Access is denied: 'e:\\programs\\python36-32\\scripts\\pip.exe'

Now, whenever I run pip at all, it results in 
Traceback (most recent call last):
  File "e:\programs\python36-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "e:\programs\python36-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\Programs\Python36-32\Scripts\pip.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'pip'

I sent an email help at python.org who directed me to create a bug report, stating that it looks like the people behind pip "didn't expect your temp directory to be on a different drive from your library directory."

components: Windows
messages: 315344
nosy: Bram Borger-Johnson, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: pip upgrade runtime crash
type: crash
versions: Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list