无法卸载numpy,

新手上路,请多包涵

我正在尝试使用 pip 卸载 numpy (我还安装了 pandas ,但我似乎已经能够卸载它)。在 `numpy 的情况下,我得到以下输出。

 pip3 uninstall numpy -vvv --log pip.txt

Uninstalling numpy-1.12.1:
  /usr/lib64/python3.6/site-packages/numpy
  /usr/lib64/python3.6/site-packages/numpy-1.12.1-py3.6.egg-info
  Removing file or directory /usr/lib64/python3.6/site-packages/numpy
Exception:
Traceback (most recent call last):
  File "/usr/lib64/python3.6/shutil.py", line 544, in move
    os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: '/usr/lib64/python3.6/site-packages/numpy' -> '/tmp/pip-odkg0wo0-uninstall/usr/lib64/python3.6/site-packages/numpy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3.6/site-packages/pip/commands/uninstall.py", line 76, in run
    requirement_set.uninstall(auto_confirm=options.yes)
  File "/usr/lib/python3.6/site-packages/pip/req/req_set.py", line 346, in uninstall
    req.uninstall(auto_confirm=auto_confirm)
  File "/usr/lib/python3.6/site-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/usr/lib/python3.6/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/usr/lib/python3.6/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/usr/lib64/python3.6/shutil.py", line 556, in move
    rmtree(src)
  File "/usr/lib64/python3.6/shutil.py", line 480, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/usr/lib64/python3.6/shutil.py", line 418, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  File "/usr/lib64/python3.6/shutil.py", line 438, in _rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
  File "/usr/lib64/python3.6/shutil.py", line 436, in _rmtree_safe_fd
    os.unlink(name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: 'multiarray_tests.cpython-36m-x86_64-linux-gnu.so'

我有一个同时运行 Python 2.7.15 和 Python 3.6.5 的 Fedora 26 系统

我是 Python 的新手(昨晚才开始学习),所以请原谅我的无知。我已经看到了几个相关的问题(主要是处理 pip 安装而不是卸载。它们似乎都没有解决问题。我还应该注意到我在这些其他帖子中读到过将 pip 作为 sudo 运行是个坏主意(有些东西我在尝试安装 pandas 时做了,因为我没有权限(我后来又读到这是一个坏主意)。感谢这里的任何帮助。

原文由 audiFanatic 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 756
1 个回答

对于 python3:

 sudo pip3 uninstall numpy

对于蟒蛇:

 sudo pip uninstall numpy

或使用:

 sudo apt-get remove python-numpy

原文由 Ebin Zacharias 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
logo
Stack Overflow 翻译
子站问答
访问
宣传栏