Macos – How to update Mac’s system Python

macospythonsoftware-update

I'm on Mavericks at the moment, and i want to update the Python system's version (2.7.5) to the latest (2.7.7) from http://www.python.org, because i want to install pygame.
What i have to do? I would like to be able to run the latest version of Python when i type python in the terminal, i searched for some guide on the net but it's all a bit confusing to me.

Best Answer

Replacing Mac OS X's system Python is not recommended due to incompatability with other software. However, there are Mac binaries on the Python download page that can be installed to a different location. Once installed, you may need to change your PATH environment variable so the new Python interpreter will run when python is invoked from the command line.

To edit your PATH, determine the absolute folder path containing the Python binary. This may look something like /Applications/Python/.../bin. Add the following line to your ~/.bash_profile file:

export PATH=/path/to/new/python/bin:$PATH

The change will take effect after you restart your shell.

Related Question