Am getting a "Permission denied" error pertaining to a file named DESCRIPTION.rst while trying to PIP uninstall a package in order to upgrade it.
I originally ran this command:
pip uninstall twilio
There was a lot of output, but the important stuff was:
...
...
/usr/local/lib/python2.7/site-packages/twilio/version.pyc
Proceed (y/n)? y
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/uninstall.py", line 59, in run
requirement_set.uninstall(auto_confirm=options.yes)
File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1035, in uninstall
req.uninstall(auto_confirm=auto_confirm)
File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 598, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1836, in remove
renames(path, new_path)
File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 295, in renames
shutil.move(old, new)
File "/usr/local/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/twilio-3.6.6.dist-info/DESCRIPTION.rst'
Storing debug log for failure in /home/chris/.pip/pip.log
[chris@boogie-dev ~]$
I'm not really sure how I should go about solving this problem. I don't understand PIP too well, or the ins and outs of python library pakcages, or what a DESCRIPTION.rst file is and why it is there with special permissions.
I already tried the command under sudo
, however PIP is not available under sudo
. I'm not sure what is the correct angle to take on this problem:
- Install pip under the sudo account and then try to uninstall using the sudo account - which is not the same account that was using to originally install the package
- Delete the
DESCRIPTION.rst
file while using sudo - Some other, more elegant approach that I'm not aware of