MacOS – Moving terminal version of python to homebrew version

command linemacospython

python -V shows that I am on 2.7.7 but brew upgrade python shows I have 2.7.8 so clearly my terminal isn't looking at the Homebrew version. How do I fix this?

Best Answer

Check if /usr/local/bin is in your PATH and that it's before /usr/bin. In the terminal:

echo $PATH

I believe brew doctor will warn you about this if it's not. Basically, if it's not, the system will look in /usr/bin first instead of /usr/local/bin, which is where homebrew links everything.

For bash, you just need to add:

export PATH=/usr/local/sbin:/usr/local/bin:$PATH

to your ~/.bash_profile file.