Python Pygame OSx 与 El Capitan 系统相关的错误

Python Pygame OSx error relating to El Capitan System

我正在 PyGame 上安装 OSx ElCapitan,在 this blog post 之后系统安装了 2.7,Brew 安装了 Python3。 brew install Python3 与

配合得很好
sudo pip3 install hg+http://bitbucket.org/pygame/pygame

但是

sudo pip install hg+http://bitbucket.org/pygame/pygame 

遇到以下错误

running install_headers
creating /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pygame


error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pygame': Operation not permitted


Rolling back uninstall of pygame
Command "/usr/bin/python -c "import setuptools, tokenize;
__file__='/tmp/pip-wepMKN-build/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" 
install --record /tmp/pip-sWpHWA-record/install-record.txt 
--single-version-externally-managed --compile" 
failed with error code 1 in /tmp/pip-wepMKN-build

我认为这与 El Capitan 中的新 System Integrity Protection 有关。之前所有内容都已更新和篡改,因此系统 运行 否则很好。

我敢肯定,任何关于我如何克服这个问题的帮助都会很棒并且对很多人都有帮助。

谢谢

克里斯

@Arthur 提供了一个 link 到一个关于这个问题的可能解决方案的线程,尽管我不确定我是否准备好关闭 SIP,所以个人会选择用户只安装建议通过上述线程上未批准的答案。