How to uninstall Python 2.7 on a Mac OS X 10.6.4?


I want to completely remove Python 2.7 from my Mac OS X 10.6.4. I managed to remove the entry from the PATH variable by reverting my .bash_profile. But I also want to remove all directories, files, symlinks, and entries that got installed by the Python 2.7 install package. I've got the install package from What directories/files/configuration file entries do I need to remove? Is there a list somewhere?



Do not remove Apple-supplied system Python present under the /System/Library and /usr/bin directories. You have to remove the third-party Python 2.7 framework.

sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7

Remove the applications directory of Python 2.7.

sudo rm -rf "/Applications/Python 2.7"

Remove the symbolic links of Python 2.7 from the /usr/bin directory.

ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7'

cd /usr/local/bin/

ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | tr -d @ | xargs rm



You have to remove the links from the python version folder in the library. 

cd /usr/local/bin/

ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | tr -d @ | xargs rm


If you want to unleash your potential in this competitive field, please visit the Python course page for more information, where you can find the Python tutorials and Python frequently asked interview questions and answers as well.


This topic has been locked/unapproved. No replies allowed

Login to participate in this discussion.

Leave a reply

Before proceeding, please check your email for a verification link. If you did not receive the email, click here to request another.