解决 Mac OS X 10.11 安装 sip 没有权限的问题
在搭建 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 的问题,那么我们把它关闭就好了:
- 重新启动系统
- 按住
Command + R进入 Recoverary 模式 - 点击 有用工具 > 终端
- 输入
csrutil disable - 重新启动系统
这时我们再又一次编译安装 sip 就没有不论什么问题了。
解决 Mac OS X 10.11 安装 sip 没有权限的问题的更多相关文章
- VMware 12安装Mac OS X 10.11&解决上网的问题
近日想在Win10上安装Mac OS 玩玩,于是上网搜了相关资源,查看了相关经验分享,开始着手安装.系统很快成功安装,但最大问题是虚拟机中的Mac OS无法上网.费了很长时间,最终看到Ping通结果, ...
- Windows下虚拟机安装Mac OS X ----- VM12安装Mac OS X 10.11
Windows下虚拟机安装Mac OS X -– VM12安装Mac OS X 10.11 随着Iphone在国内大行其道,越来越多的开发者涌入iOS开发大军 中,但都苦于没有苹果机,本文即将介绍WI ...
- Windows下虚拟机安装Mac OS X —– VM12安装Mac OS X 10.11
____________________________________________________________________________________________________ ...
- VMware 12安装Mac OS X 10.11
去年写了一篇安装Mac OS X 10.10的文章,看到大家都想体验OS X,大多数都能成功,但也在其中发现了一些问题,所以更新一下,希望对大家有所帮助. 1048VMware 11安装Mac O ...
- VMware Workstation 12 安装mac os x 10.11
本人近期在学习iOS开发,由于初学,购买设备有点太昂贵了点.和我有意向想法的朋友能够看看在这篇文章.在虚拟机里装MAC os系统. 第一步:准备 VMware Workstation 12版本号 ma ...
- VMware 10安装Mac OS X 10.11和XCode7
上周把我的计算机当试验品,安装mac虚拟机.由于文件下载复制解压的时间花了很长,历时两天,记录下来(和我一样的新手不妨参考一下): 我机硬件:win7 64位 8G内存 没有8G以上就不要考虑了.我安 ...
- Caffe on Mac OS X 10.11
在Mac环境安装Caffe环境(CPU_ONLY) http://blog.csdn.net/xidiancoder/article/details/52081519 有问题 http://blo ...
- 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 ...
- windows10 VM12 安装Mac OS X 10.11
转载自:http://blog.csdn.net/j755ing/article/details/69400439 第一步: 下载 材料/工具: 下载 VMware Workstation 12 Pr ...
随机推荐
- 安装visual studio 2013【转】
本文转载自:http://blog.csdn.net/tina_ttl/article/details/51544733#1下载-visual-studio-ultimate-2013安装包 微软已经 ...
- php中一个经典的!==的用法
php中一个经典的!==的用法 <?php $str = 'Every time you bleed for reaching greatness.'; $cha = 'E'; if(strpo ...
- [转载]RouteOS安装设置
原文地址:RouteOS安装设置作者:抟鹏追梦 RouteOS2.7.4可以将一台普通的PC机变成一台专业的路由器,高到ISP的核心路器/认证网关-因为它功能强大稳定,低到家庭网关防火墙-因为它免费. ...
- 彻底弄懂px em rem
国内的设计师大都喜欢用px,而国外的网站大都喜欢用em和rem,那么三者有什么区别,又各自有什么优劣呢? PX特点 1. IE无法调整那些使用px作为单位的字体大小: 2. 国外的大部分网站能够调整的 ...
- js设计模式-命令模式
命令模式是一种组织型模式,主要用在把调用对象(用户界面.API和代理等)与实现操作的对象隔离开.也就是说 ,凡是两个对象间的互动方式需要更高的模块化程度时都可以用到这种模式. 命令模式的好处:1.提高 ...
- SDAutoLayout的使用
## 简介- IOS布局的三个阶段:MagicNumber -> AutoResizingMask -> AutoLayout- 自动布局三大框架:UILayoutConstraint(原 ...
- BZOJ2134: 单选错位(期望乱搞)
Time Limit: 10 Sec Memory Limit: 259 MBSubmit: 1101 Solved: 851[Submit][Status][Discuss] Descripti ...
- C# 学习笔记1 _ 学习要点
程序开始 MainConsole.WriteLine(“换行”);Console.Write(“不换行”);Console.ReadKey(); 等待用户从键盘上键入一个键.Console.Cle ...
- APUE学习笔记3——文件和目录
1 简介 之前学习了执行I/O操作的基本函数,主要是围绕普通文件I/O的打开.读或写.下面继续学习Unix文件系统的其他特征和文件的基本性质.我们将从stat函数开始,了解stat结构所代表的文件属性 ...
- 杭电 2035 人见人爱A^B【同余】
#include<stdio.h> int main() { int a,b; int s; int i; while(scanf("%d %d",&a,&am ...