alexkras.com

  • Home
  • Top Posts
  • Resume
  • Projects
  • YouTube
  • Boots to Bytes
  • About
  • Contact

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

August 2, 2017 by Alex Kras 1 Comment

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

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)

Filed Under: Python

I work for Evernote and we are hiring!

Subscribe to this Blog via Email

New posts only. No other messages will be sent.

You can find me on LinkedIn, GitHub, Twitter or Facebook.

This blog is moving to techtldr.com

Comments

    Leave a Reply Cancel reply

  1. Python3 says

    March 21, 2019 at 8:04 pm

    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.

    Reply

Copyright © 2021 · eleven40 Pro Theme on Genesis Framework · WordPress · Log in