Sudo pip install upgrade operation not permitted
<p>I am trying to upgrade Numpy on Python 2.7 on Mac El Capitan, but I keep getting errors. I have Numpy v1.8.0rc1 and I need the latest one.</p>

<p><code>sudo pip2 install --upgrade numpy</code></p>

<p><code>...</code></p>

<p><code>OSError: [Errno 1] Operation not permitted: '/tmp/pip-HUSiK5-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'</code></p>

<p>If I do
<code>which pip2</code>
I get
<code>/usr/local/bin/pip2</code></p>

<p>And <code>which python</code> gives <code>/usr/bin/python</code></p>

<p>Also, I installed Python 3.5, if that matters.</p>

<p>You're likely running into System Integrity Protection, the system introduced by Apple to prevent modification of system files (see <a href="https://apple.stackexchange.com/questions/209572/how-to-use-pip-after-the-os-x-el-capitan-upgrade">this answer on Ask Different</a>). Your options are approximately:</p>

<ul>
<li>install your own version of Python (using Homebrew or another system, e.g. <code>brew install python</code>)</li>
<li><a href="https://apple.stackexchange.com/questions/208478/how-do-i-disable-system-integrity-protection-sip-aka-rootless-on-os-x-10-11">Disable System Integrity Protection</a> (not recommended unless you know what you're doing)</li>
</ul>

python numpy pip upgrade