解决 Mac OS X 10.11 安装 sip 没有权限的问题
2018-02-19 20:53
507 查看
在搭建 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 没有权限的问题
- 【转载】在 Mac OS X El Capitan 文件权限问题解决方法 (以安装 IPython 和 XtraFinder为例)
- MAC下解决pip安装权限问题 OSError: [Errno 13] Permission denied OSError: [Errno 1] Operation not permitted:
- Mac OS X 10.11 因 SIP 安全问题无法运行某些 APP 的解决方法
- 转载】在 Mac OS X El Capitan 文件权限问题解决方法 (以安装 IPython 为例)
- 解决mac下安装yeoman时没有权限问题
- Mac OS X 跟新到10.11后cocoapods安装出现的问题(- bad response Not Found 404 (http://ruby.taobao.org/latest_spe)
- 解决vmware虚拟机安装苹果系统Mac OS X 10.10出现“二进制转换不支持用于Mac OS X”的问题。
- 解决近期Mac无法安装docker-compose的问题(docker compose installation for OS X EI Capitan)
- Mac OS X 跟新到10.11后cocoapods安装出现的问题
- 在virtualbox上安装mac os mavericks遇到Missing Bluetooth Controller Transport问题解决办法
- Mac OS X 更新到10.11后cocoapods安装出现的问题(- bad response Not Found 404 (http://ruby.taobao.org/latest_spe)
- Mac OS X 跟新到10.11后cocoapods安装出现的问题(- bad response Not Found 404 (http://ruby.taobao.org/latest_spe)
- Mac OS X升级到10.11之后不能使用pod的问题解决方法
- mac os x el capitan 10.11 对系统文件的读写权限问题
- 在MAC OS X编译eXosip不成功的问题解决
- mac 下安装cocos2d-x遇到没有权限的问题  
- 解决Virtual Box 下安装Mac OS X时出现的“hfs: could not initializc summary table for OSX Base System ”问题
- mac 下安装cocos2d-x遇到没有权限的问题
- Mac os x 下配置Intellij IDEA + Tomcat 出现权限问题的解决办法