Python 3.5.0b2 - permission error after pip upgrade

Chris Angelico rosuav at gmail.com
Thu Jun 11 15:15:49 EDT 2015


On Fri, Jun 12, 2015 at 4:57 AM, Andreas Balogh <baloand at gmail.com> wrote:
> I've installed a fresh copy of Python 3.5.0b2 and - as recommended - upgraded pip. I don't
> understand the reason for the permission errors as I am owner and have full control for
> the temporary directory created.
>
> What can I do to fix this?
>
>
> C:\Apps\Python35>pip install --upgrade pip
>   File "C:\Apps\Python35\lib\shutil.py", line 377, in _rmtree_unsafe
>     os.unlink(fullname)
> PermissionError: [WinError 5] Access is denied:
> 'C:\\Users\\Andreas\\AppData\\Local\\Temp\\pip-xf9kwi7g-uninstall\\apps\\python35\\scripts\\pip.exe'

This is a problem with the way Windows locks running executables,
conflicting with the way pip wants to delete (unlink) the executable.
It appears to be a known issue by the pip people:

https://github.com/pypa/pip/issues/2773

One workaround is to skip the short-hand "pip" when upgrading pip
itself, and type out the command in full:

python -m pip install --upgrade pip

Just make sure you run the same Python (so you may need to run
"python3 -m pip etc", not sure) so it upgrades the right pip.

ChrisA



More information about the Python-list mailing list