I found that compilation issues like these are easily avoided by installing python via brew. If brew isn't able to link the formula, just force it with:
brew link --overwrite python
See also: http://docs.python-guide.org/en/latest/starting/install/osx/