本博自豪的采用PHP7。 PHP是世界上最好的语言,没有之一。

macosx 10.11 python pip install 出现错误OSError: [Errno 1] Operation not permitted:

Linux/Unix admin 464次浏览 已收录 0个评论 扫描二维码
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/basecommand.py", line 211, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/commands/install.py", line 311, in run
    root=options.root_path,
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_set.py", line 640, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 716, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_uninstall.py", line 125, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/utils/__init__.py", line 315, 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/tx/22hzdby50gg4cbnzx_39c5dm0000gn/T/pip-ziJ8uF-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'
macosx 10.11 python pip install 出现错误OSError: [Errno 1] Operation not permitted:

解决方案

macosx 10.11 python pip install 出现错误OSError: [Errno 1] Operation not permitted:
pip install --upgrade pip

sudo pip install numpy --upgrade --ignore-installed

sudo pip install scipy --upgrade --ignore-installed

sudo pip install scikit-learn --upgrade --ignore-installed
macosx 10.11 python pip install 出现错误OSError: [Errno 1] Operation not permitted:

如果还不能解决的话

1、重启电脑,按command+R进入恢复模式,点击菜单【实用工具】,打开【终端】,输入 csrutil disable

2、重启电脑,正常进入,打开【终端】输入 csrutil  status

这是macosx 10.11 EI Capitan使用了Rootlees,可以理解为一个更高等级的内核保护,系统会默认锁定/system , /sbin , /usr这三个目录,

通过上面方法可以将这个保护关闭。

如果没有关闭,安装一些软件时会出现

Operation not permitted

pitata技术乐园 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明macosx 10.11 python pip install 出现错误OSError: [Errno 1] Operation not permitted:
喜欢 (0)
[103531948@qq.com]
分享 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址