Saturday, 23 April 2011

Python 2.7 Mac OS X uninstall

The complete list is documented at The following steps are done inside a terminal session and assume you know how to use the command line. All the terminal command lines below are single lines, even if they appear as two lines in your web browser or this blog post.

To completely remove Python 2.7 from my Mac OS X 10.6:

Remove the entry from the PATH variable by reverting my .bash_profile, edit or delete the file:
nano .bash_profile (remove the PATH lines added by the Python installer, they are commented, so you'll se them easily)
Remove the Python 2.7 framework:
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
Remove the Python 2.7 applications directory
sudo rm -rf "/Applications/Python 2.7"
Remove the symbolic that point back to the 2.7 framework in /usr/local/bin:
Find them with the following ls command, then remove with sudo rm -rf like in the previous steps.
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7'
In my case, I typed the following commands following the output of the previous ls line:
cd /usr/local/bin 
sudo rm -rf 2to3 idle idle2.7 pydoc pydoc2.7 python python-32 python-config pythonw pythonw-32

Information taken from:
Credits to the users listed there, especially Ned, who answered the question in such a clear and concise way.

Python on Macs

If you need or want to install and use the latest versions of Python (2.7.1 and 3.2 at the time of writing this post) on Mac OS X, please make sure you read the following web page that contains essential information on what do download and install in order to have a better experience.

In a nutshell:

Do not use IDLE or tkinter with the Python 3.2 64-bit/32-bit installer for Mac OS X 10.6 unless you can install ActiveTcl 8.5. Otherwise use the 3.2 32-bit-only installer instead.

Do not use IDLE or Tkinter with the Python 2.7.1 64-bit/32-bit installer for Mac OS X 10.6. Install the 2.7.1 32-bit-only installer instead.

Do not use IDLE or Tkinter with the Apple-supplied Python 2.6.1 in Mac OS X 10.6. Install a newer version of Python 2.6 or later.

Python's integrated development environment, IDLE, and the tkinter GUI toolkit it uses, depend on the Tk GUI toolkit which is not part of Python itself. For best results, it is important that the proper release of Tcl/Tk is installed on your machine." (IDLE and tkinter with Tcl/Tk on Mac OS X)

Algorithms and Abstract Data Types HL

Resources about various algorithms - Higher Level:  - various algorithms (sort, binary search) and pr...