mac上安装numpy一直报错

OSError: [Errno 1] Operation not permitted: '/var/folders/x6/tn_0640j7mz9v04r1qbydf9h0000gn/T/pip-HKjtzS-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'

原因


It is hard to get pip working on El Capitan for several reasons:

OS X doesn't set some distutils variables correctly, so pip tries to install ancillary files in locations under /System/Library/. El Capitan blocks this, which is the error you are running into.
OS X includes a number of outdated packages under /System/Library/. pip often wants to upgrade these but cannot on El Capitan.
OS X places /System/Library/ higher in the python search order than /Library/Python/2.7/site-packages (the system-wide python package location), so even if you manage to install newer versions of some packages, the old ones still get loaded, breaking some dependencies.
There are workarounds for all of these at http://apple.stackexchange.com/a/223163/143849 . But you may be best off installing your own version of Python via the standard Python installer, Homebrew or Anaconda.

解决方案
http://apple.stackexchange.com/questions/209572/how-to-use-pip-after-the-os-x-el-capitan-upgrade/223163#223163