在搭建 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. Android之UtilsRequesServicetHelp工具类

    package com.example.getnetutil; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; ...

  2. POJ1179 Polygon 区间DP

    题目大意: 多边形游戏,有N个顶点的多边形,3 <= N <= 50 ,多边形有N条边,每个顶点中有一个数字(可正可负),每条边上或者是“+”号,或者是“*”号.边从1到N编号,首先选择一 ...

  3. linux下的开源移动图像监测程序--motion编译与配置【转】

    本文转载自:http://www.cnblogs.com/qinyg/p/3355707.html 前几天在网上偶然看到一篇博客,是利用linxu下的开源的motion搭建嵌入式视频动态监控系统,感觉 ...

  4. Adding Search

    https://docs.asp.net/en/latest/tutorials/first-mvc-app/search.html In this section you’ll add search ...

  5. Unsupported major.minor version 52.0 (unable to load class XXX

    java项目构建从高版本JDK改为低版本JDK报错.这是再次编译时使用的JDK版本比你原来编译的版本低所导致的. 转自:http://blog.csdn.net/zixiao217 maven项目在服 ...

  6. 爬虫—分析Ajax爬取今日头条图片

    以今日头条为例分析Ajax请求抓取网页数据.本次抓取今日头条的街拍关键字对应的图片,并保存到本地 一,分析 打开今日头条主页,在搜索框中输入街拍二字,打开开发者工具,发现浏览器显示的数据不在其源码里面 ...

  7. golang iris html/temple

    在使用golang的模板语法的过程中遇见自动转义问题(或者以我的理解下发的富文本html代码不是template.html类型,而是string类型),需要强制转型 func unescaped(x ...

  8. cloudfoundry service broker 制作

    实验室这边需要制作service broker.从今天开始将精力投入其中.

  9. C# List<T>转成DataTable

    //将List<T>转成DataTable         public static DataTable ToDataTable(List<T> collection)    ...

  10. 深度讲解智能硬件手机APP开发流程

    常州做APP开发公司紫竹云科技分析,智能硬件产品的软件开发,除了APP和后台之外还有一个固件端的开发,由于固件是要运行产品上的,不过此时的硬件也是刚开始进行研发,所以是无法提供硬件来运行固件的.因此在 ...