在搭建 PYQT 的过程中我遇上了一个非常恶心的问题,在安装 sip 的时候编译源代码之后的安装过程中一直提示我:Operation not permitted ,我甚至重装了系统也无济于事,终于通过查资料攻克了问题。

安装 sip

下载 sip 源代码包解压之后进入它的文件夹下:

python configure.py
sudo make
sudo make install

这时出现了一个非常恶心的报错提示:

cp -f sip /System/Library/Frameworks/Python.framework/Versions/2.7/bin/sip
cp: /System/Library/Frameworks/Python.framework/Versions/2.7/bin/sip: Operation not permitted
make[1]: *** [install] Error 1
make: *** [install] Error 2

于是乎,我用 su 登录 Shell。在反复以上过程,无果。

之后,我又使用 brew install sip,报相同的错误。

然后我又进入 /System/Library/Frameworks/Python.framework 文件夹打算一探到底:

试图改动它的权限。结果:

原因

经历了XCode编译器代码被注入的事件后,这次 Mac OS X El Capitan系统的升级,启用了更高的安全性保护机制:系统完整性保护System Integrity Protection (SIP)。简单来讲就是更加强制性的保护系统相关的文件夹。开发人员不能直接操作相关的文件内容。

苹果官方给出的解释:

System Integrity Protection is a security technology in OS X El Capitan that’s designed to help prevent potentially malicious software from modifying protected files and folders on your Mac.

In OS X, the “root” user account previously had no permission restrictions and could access any system folder or application on your Mac. Software gained root-level access when you entered your administrator name and password to install it and could then modify or overwrite any system file or application.

System Integrity Protection restricts the root account and limits the actions that the root user can perform on protected parts of OS X.

Paths and applications protected by System Integrity Protection include:

/System

/usr

/bin

/sbin

Apps that are pre-installed with OS X

Paths and applications that third-party apps and installers can write to include:

/Applications

/Library

/usr/local

System Integrity Protection is designed to allow modifications of these protected parts only by processes that are signed by Apple and have special entitlements to write to system files, like Apple software updates and Apple installers.

Apps that you download from the Mac App Store already work with System Integrity Protection. Other third-party software that conflicts with System Integrity Protection might be set aside when you upgrade to OS X El Capitan.

System Integrity Protection also helps prevent software from changing your startup volume. To boot your Mac from a different volume, you can use the Startup Disk pane in System Preferences or you can hold down the Option key while you reboot, and select a volume from the list.

Information about products not manufactured by Apple, or independent websites not controlled or tested by Apple, is provided without recommendation or endorsement. Apple assumes no responsibility with regard to the selection, performance, or use of third-party websites or products. Apple makes no representations regarding third-party website accuracy or reliability. Risks are inherent in the use of the Internet. Contact the vendor for additional information. Other company and product names may be trademarks of their respective owners.

https://support.apple.com/en-us/HT204899

解决方式

事实上解决方式就已经非常easy了,既然是系统中有 SIP 的问题,那么我们把它关闭就好了:

  1. 重新启动系统
  2. 按住 Command + R 进入 Recoverary 模式
  3. 点击 有用工具 > 终端
  4. 输入 csrutil disable
  5. 重新启动系统

这时我们再又一次编译安装 sip 就没有不论什么问题了。

解决 Mac OS X 10.11 安装 sip 没有权限的问题的更多相关文章

  1. VMware 12安装Mac OS X 10.11&解决上网的问题

    近日想在Win10上安装Mac OS 玩玩,于是上网搜了相关资源,查看了相关经验分享,开始着手安装.系统很快成功安装,但最大问题是虚拟机中的Mac OS无法上网.费了很长时间,最终看到Ping通结果, ...

  2. Windows下虚拟机安装Mac OS X ----- VM12安装Mac OS X 10.11

    Windows下虚拟机安装Mac OS X -– VM12安装Mac OS X 10.11 随着Iphone在国内大行其道,越来越多的开发者涌入iOS开发大军 中,但都苦于没有苹果机,本文即将介绍WI ...

  3. Windows下虚拟机安装Mac OS X —– VM12安装Mac OS X 10.11

    ____________________________________________________________________________________________________ ...

  4. VMware 12安装Mac OS X 10.11

    去年写了一篇安装Mac OS X 10.10的文章,看到大家都想体验OS X,大多数都能成功,但也在其中发现了一些问题,所以更新一下,希望对大家有所帮助.   1048VMware 11安装Mac O ...

  5. VMware Workstation 12 安装mac os x 10.11

    本人近期在学习iOS开发,由于初学,购买设备有点太昂贵了点.和我有意向想法的朋友能够看看在这篇文章.在虚拟机里装MAC os系统. 第一步:准备 VMware Workstation 12版本号 ma ...

  6. VMware 10安装Mac OS X 10.11和XCode7

    上周把我的计算机当试验品,安装mac虚拟机.由于文件下载复制解压的时间花了很长,历时两天,记录下来(和我一样的新手不妨参考一下): 我机硬件:win7 64位 8G内存 没有8G以上就不要考虑了.我安 ...

  7. Caffe on Mac OS X 10.11

    在Mac环境安装Caffe环境(CPU_ONLY) http://blog.csdn.net/xidiancoder/article/details/52081519   有问题 http://blo ...

  8. Windows下虚拟机安装Mac OS X —– VMware Workstation12安装Mac OS X 10.11

    1下载  镜像:Instal OS X Yosemite 10.10.3(14D131).cdr        密码:qhhm 2 unlocker208文件(链接:https://pan.baidu ...

  9. windows10 VM12 安装Mac OS X 10.11

    转载自:http://blog.csdn.net/j755ing/article/details/69400439 第一步: 下载 材料/工具: 下载 VMware Workstation 12 Pr ...

随机推荐

  1. luogu1082 同余方程

    题目大意:求$$ax\equiv 1(\ \mathrm{mod}\ m)$$的最小正整数解. 因为$ax-1|m$,故令$ax-1=-ym$,原方程就变成了$ax+my=1$.根据bezout定理此 ...

  2. NUnit Console Command Line

    https://github.com/nunit/docs/wiki/Console-Command-Line The console interface runner is invoked by a ...

  3. 深度 | AI芯片之智能边缘计算的崛起——实时语言翻译、图像识别、AI视频监控、无人车这些都需要终端具有较强的计算能力,从而AI芯片发展起来是必然,同时5G网络也是必然

    from:https://36kr.com/p/5103044.html 到2020年,大多数先进的ML袖珍电脑(你仍称之为手机)将有能力执行一整套任务.个人助理将变的更加智能,它是打造这种功能的切入 ...

  4. 什么是URL?网址的组成

    欢迎加入前端交流群交流知识&&获取视频资料:749539640 和 Hypertext 以及 HTTP 一样,URL是Web中的一个核心概念.它是浏览器用来检索web上公布的任何资源的 ...

  5. js设计模式-组合模式

    组合模式是一种专为创建web上的动态用户界面而量身定制的模式.使用这种模式,可以用一条命令在多个对象上激发复杂的或递归的行为.这可以简化粘合性代码,使其更容易维护,而那些复杂行为则被委托给各个对象. ...

  6. BZOJ 4262 线段树+期望

    思路: 把询问离线下来,查询max和查询min相似,现在只考虑查询max 令sum[l,r,x]表示l到r内的数为左端点,x为右端点的区间询问的答案 那么询问就是sun[l1,r1,r2]-sum[l ...

  7. ADO.NET增删改

    static void Main1(string[] args) {添加造连接字符串string connstring = "server=.;database=mydb;user=sa;p ...

  8. react拼接class&将JS标签转换为HTML

    1.在JS中混杂字符和HTML标签,识别方法: const menuList = ['门店', '星享俱乐部', '菜单', '<hr></hr>', '星巴克移动应用', ' ...

  9. Singleton pattern的线程安全问题

    original post from here方法一:同步机制关键词public class Singleton { 2 //利用静态变量来记录Singleton的唯一实例 3 private sta ...

  10. Jmeter报内存溢出解决方案

    描述:wimdows环境,做上传图片接口测试,涉及图片合成和上传,图片采用base64编码.每1s启动200线程的时候,Jmeter报内存溢出错误. 解决方案: 1.修改jmeter.bat: set ...