MacPython 2.4 to Default Python on Snow Leopard

I recently installed MacPython 2.4 while trying to get Plone installed using buildout rather than a binary build from plone.org. After I gave up and decided to use a binary build, I wanted to remove MacPython as the binary build comes with its own version of Python 2.4.

You need to uninstall MacPython manually, as there is no automated uninstaller. The documentation at python.org on removing MacPython and reverting to OS X’s default Python installation isn’t quite complete. I needed to follow a couple of extra steps, the final two below.

Here are the steps I needed to complete to fully revert to the system python:

  1. Remove the MacPython 2.4 folder from your Applications folder.
  2. Remove the installed Python framework using a terminal: sudo rm -rf /Library/Frameworks/Python.framework. Do not remove /System/Library/Frameworks/Python.framework as this is the system version!
  3. Delete the symlink to python from /usr/local/bin/python
  4. Check whether you have a ~/.bash_profile.pysave created by the MacPython installer.
    • If you do, restore your default .bash_profile from the backup: rm ~/.bash_profile then mv ~/.bash_profile.pysave ~/.bash_profile.
    • If you don’t, modify the PATH in your ~/.bash_profile to remove the path starting /Library/Frameworks/Python.framework

You should now be able to start the default Python installed with OS X:

$ python
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

Voila!