Python 3.5.0b2 - permission error after pip upgrade

Zachary Ware zachary.ware+pylist at gmail.com
Thu Jun 11 15:41:05 EDT 2015


On Thu, Jun 11, 2015 at 2:15 PM, Chris Angelico <rosuav at gmail.com> wrote:
> 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.

More accurately for Windows, you'll probably want 'py -3.5 -m pip ...'.

-- 
Zach



More information about the Python-list mailing list