ubuntu python pip无法卸载枕头

时间:2015-02-21 16:03:44

标签: python pip pillow

当我尝试使用pip卸载枕头时,它输出:

qixin@qixin:~$ pip uninstall pillow
Uninstalling Pillow:
  /usr/local/bin/pilconvert.py
  ......
  /usr/local/lib/python2.7/dist-packages/Pillow-2.7.0.egg-info
Proceed (y/n)? y
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg/pip/commands/uninstall.py", line 59, in run
    requirement_set.uninstall(auto_confirm=options.yes)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1035, in uninstall
    req.uninstall(auto_confirm=auto_confirm)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 598, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1836, in remove
    renames(path, new_path)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 295, in renames
    shutil.move(old, new)
  File "/usr/lib/python2.7/shutil.py", line 303, in move
    os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/bin/pilconvert.py'

Storing debug log for failure in /tmp/tmpEmRbAF

我的操作系统是ubuntu 14.04,python的版本是2.7。 为什么会失败?非常感谢!

3 个答案:

答案 0 :(得分:2)

这是因为您运行的命令没有正确的操作系统级别权限。在Windows上,该命令可以正常工作,但在Ubuntu pip上需要添加sudo才能使它成为root用户并获得正确的权限。

您应该输入sudo pip uninstall pillow

答案 1 :(得分:1)

我不得不升级pip本身,然后才有效。

pip install --upgrade pip

答案 2 :(得分:0)

许可被拒绝。试试sudo pip uninstall pillow