我正在尝试通过Pip卸载Numpy,但出现此错误:

$ pip uninstall numpy

Uninstalling numpy:
  /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.6.2-py2.7.egg-info
Proceed (y/n)? y
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/uninstall.py", line 54, in run
    requirement_set.uninstall(auto_confirm=options.yes)
  File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 899, in uninstall
    req.uninstall(auto_confirm=auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 495, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1518, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/util.py", line 293, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    os.unlink(src)
 OSError: [Errno 13] Permission denied: '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.6.2-py2.7.egg-info'

不知道从这里开始的最佳方法是什么。我想完全卸载numpy,然后重新安装。

最佳答案

尝试:

sudo pip uninstall numpy

或者,如果它不起作用:
sudo apt-get remove python-numpy

关于python - 使用pip卸载numpy时权限被拒绝,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35567511/

10-11 07:34