Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #92498 > unrolled thread

Python 3.5.0b2 - permission error after pip upgrade

Started byAndreas Balogh <baloand@gmail.com>
First post2015-06-11 20:57 +0200
Last post2015-06-11 14:41 -0500
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Python 3.5.0b2 - permission error after pip upgrade Andreas Balogh <baloand@gmail.com> - 2015-06-11 20:57 +0200
    Re: Python 3.5.0b2 - permission error after pip upgrade Chris Angelico <rosuav@gmail.com> - 2015-06-12 05:15 +1000
    Re: Python 3.5.0b2 - permission error after pip upgrade Zachary Ware <zachary.ware+pylist@gmail.com> - 2015-06-11 14:41 -0500

#92498 — Python 3.5.0b2 - permission error after pip upgrade

FromAndreas Balogh <baloand@gmail.com>
Date2015-06-11 20:57 +0200
SubjectPython 3.5.0b2 - permission error after pip upgrade
Message-ID<mlcll0$o3b$1@dont-email.me>
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
You are using pip version 7.0.1, however version 7.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pip
  Downloading pip-7.0.3-py2.py3-none-any.whl (1.1MB)
    100% |################################| 1.1MB 422kB/s
Installing collected packages: pip
  Found existing installation: pip 7.0.1
    Uninstalling pip-7.0.1:
      Successfully uninstalled pip-7.0.1
Exception:
Traceback (most recent call last):
  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'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Apps\Python35\lib\site-packages\pip\basecommand.py", line 223, in main
    status = self.run(options, args)
  File "C:\Apps\Python35\lib\site-packages\pip\commands\install.py", line 297, in run
    root=options.root_path,
  File "C:\Apps\Python35\lib\site-packages\pip\req\req_set.py", line 633, in install
    requirement.commit_uninstall()
  File "C:\Apps\Python35\lib\site-packages\pip\req\req_install.py", line 734, in
commit_uninstall
    self.uninstalled.commit()
  File "C:\Apps\Python35\lib\site-packages\pip\req\req_uninstall.py", line 153, in commit
    rmtree(self.save_dir)
  File "C:\Apps\Python35\lib\site-packages\pip\_vendor\retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "C:\Apps\Python35\lib\site-packages\pip\_vendor\retrying.py", line 212, in call
    raise attempt.get()
  File "C:\Apps\Python35\lib\site-packages\pip\_vendor\retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "C:\Apps\Python35\lib\site-packages\pip\_vendor\six.py", line 659, in reraise
    raise value
  File "C:\Apps\Python35\lib\site-packages\pip\_vendor\retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "C:\Apps\Python35\lib\site-packages\pip\utils\__init__.py", line 89, in rmtree
    onerror=rmtree_errorhandler)
  File "C:\Apps\Python35\lib\shutil.py", line 484, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Apps\Python35\lib\shutil.py", line 374, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Apps\Python35\lib\shutil.py", line 374, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Apps\Python35\lib\shutil.py", line 374, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Apps\Python35\lib\shutil.py", line 379, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Apps\Python35\lib\site-packages\pip\utils\__init__.py", line 101, in
rmtree_errorhandler
    func(path)
PermissionError: [WinError 5] Access is denied:
'C:\\Users\\Andreas\\AppData\\Local\\Temp\\pip-xf9kwi7g-uninstall\\apps\\python35\\scripts\\pip.exe'


-- 
baloand (at) gmail.com

[toc] | [next] | [standalone]


#92499

FromChris Angelico <rosuav@gmail.com>
Date2015-06-12 05:15 +1000
Message-ID<mailman.407.1434050159.13271.python-list@python.org>
In reply to#92498
On Fri, Jun 12, 2015 at 4:57 AM, Andreas Balogh <baloand@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

[toc] | [prev] | [next] | [standalone]


#92500

FromZachary Ware <zachary.ware+pylist@gmail.com>
Date2015-06-11 14:41 -0500
Message-ID<mailman.408.1434051689.13271.python-list@python.org>
In reply to#92498
On Thu, Jun 11, 2015 at 2:15 PM, Chris Angelico <rosuav@gmail.com> wrote:
> On Fri, Jun 12, 2015 at 4:57 AM, Andreas Balogh <baloand@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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web