【问题标题】:'OSError: [Errno 1] Operation not permitted' When trying to update pandas/numpy'OSError: [Errno 1] Operation not allowed' 尝试更新 pandas/numpy 时
【发布时间】:2018-05-29 02:18:56
【问题描述】:

尝试卸载 numpy 时,我收到以下消息:

bvtmac00301:~ jonmc$ pip uninstall numpy
DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling numpy-1.8.0rc1:
  /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info
Proceed (y/n)? y
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/uninstall.py", line 76, in run
    requirement_set.uninstall(auto_confirm=options.yes)
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 346, in uninstall
    req.uninstall(auto_confirm=auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/y1/7zsj8_x973n4xjwg5gg6s53jr4zz65/T/pip-C3YeRV-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'

我正在尝试卸载 numpy 以对其进行更新,以便它可以与 pandas 一起运行(需要 numpy 1.9)。运行以下命令

pip install -U numpy

给出相同的结果

【问题讨论】:

  • 您使用的是什么操作系统?您是否具有从指定位置复制或删除文件的适当权限。例如,在大多数 linux 发行版中,您应该以 root 身份调用 pip install -U numpy 或使用 sudo
  • macOS High Sierra。是的,我有 root 权限。不幸的是,使用 sudo 运行会产生相同的结果。
  • 目录/System/Library/Frameworks/Python.framework上是否有任何标志?您可以通过ls -lO 看到它们。
  • 我看到drwxr-xr-x 8 root wheel restricted 256 Dec 14 10:38 Python.framework

标签: python pandas numpy pip


【解决方案1】:

试试:

pip install pandas --user

【讨论】:

    猜你喜欢
    • 2017-12-23
    • 2014-07-18
    • 2016-01-05
    • 2017-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-08
    相关资源
    最近更新 更多