For those impatient: OS X EI Capitan shipped a security feature named System Integrity Protection, which would be a hinder for pip. Try to install IPython in user mode: pip install ipython --user.

As a new Pythoner, I want to learn IPython spontaneously. I read the release notes carefully and found that the latest IPython 6.0 drops Python 2.7 support. This is not a good news for me, who works on OS X EI Caption and built-in Python 2.7.10.

Nonetheless, pip can easily find the last compatible version, so I execute the following command with confidence:

pip install ipython

At the beginning of log, I can see that pip successfully located IPython 5.4.1, so the pip install ipython==5.4.1 is redundant.

Unfortunately, the end shows an Exception caused by Operation not permitted.

It struck me that I encountered a permission issue, and the quickest solution is sudo:

sudo pip install ipython

Again I got the same Exception. How about easy_install? Let me try my shot. Oh, no luck.

After googling a while, I found that EI Capitan should be blamed. EI Capitan introduced a System Integrity Protection, which would protect system directory from writing. Okay, it’s the culprit, should we put it in jail? Of course you can, but before that you must deliberate the official guide.

So if you decide to enable SIP, the workaround (not workaround, it is highly recommended to install Python package in user mode) to install IPython is :

pip install ipython --user

After that, IPython would be placed under /Users/guoqing/Library/Python/2.7/lib. ipython command is still available now, you have to involve /Users/guoqing/Library/Python/2.7/bin into $PATH:

export PATH="$PATH:/Users/guoqing/Library/Python/2.7/bin"

End. Hope this helps.