Replace Mac Python With Homebrew Python

I got HomeBrew on my mac and managed to replace mac

1
python 2.7.5
with
1
python 2.7.6
because the recent Maverick update messed up my python and keep giving the error:

	error: command 'cc' failed with exit status 1

Replace mac python with Brew Python

Relatively straight forward with Brew. If you don’t have Homebrewm, just follow the instruction on the homepage:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew doctor
brew install python

Check your python version with

1
python --version
.

It should give

python 2.7.6

If you are still getting

1
python 2.7.5
then make sure your path is correct. Check your
1
$PATH
with
1
echo $PATH
. Since brew install packages in
1
/usr/local/bin
instead of systemwide
1
/usr/bin
, make sure that your
1
$PATH
starts with
1
/usr/local/bin
. Add this to your
1
~/.bash_profile
(or
1
~/.profile
or
1
~/.bashrc
but stick with
1
~/.bash_profile
if you don’t have the others):

# add custom, local installations to PATH
PATH=/usr/local/bin:"$PATH"

Then in the Terminal, source it

source ~/.bash_profile

Now recheck your python with

1
python --version
.