Fix Issue with Python installed via Brew after OS X El Capitan 10.11.6 Update

Looks like the recent update to OS X El Capitan version 10.11.6 breaks python installed via homebrew. At least it happened to me both on my work and my home machines.

If you are experience the same issue, you may see something that looks as following:

$ python
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

$ pip
-bash: pip: command not found

~$ python --version
Python 2.7.10

~$ pip --version
-bash: pip: command not found
Code language: PHP (php)

Here are the steps that I took to fix the issue:

  1. Open ~/.bash_profile in my text editor of choice
  2. Add the following line at the end of the file export PATH="/usr/local/opt/python/libexec/bin:$PATH"
  3. Save and exit the file
  4. From terminal, run source ~/.bash_profile. Note that this step is optional, and needed only if you already had the terminal open.

After which, the pyhon again was getting loaded from the right path:

~$ python --version
Python 2.7.13
~$ pip --version
pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)
Code language: JavaScript (javascript)

1 thought on “Fix Issue with Python installed via Brew after OS X El Capitan 10.11.6 Update”

  1. This helped me after hours of scouring the web. All the suggestions I kept stumbling upon involved aliases and symlinks and Update Shell Profile and nothing was a satisfactory solution. My problem was that I followed “The Hitchhiker’s Guide to Python” and they made a point of recommending the old El Capitan (and Sierra) PATH for export. It seems the guide was not updated for the OS X 10.11.6 update. Thanks to you, my shell is behaving as expected now.

Comments are closed.