Is it safe to uninstall Python 2 from OS X 10.8 (Mountain Lion)?

I'm doing a clean-out and refresh of my programming environment and since all the coding I do is in Python 3, I'm wondering if the easiest and cleanest option is to just completely remove Python 2 from my machine.

My main question is: Does OS X have any Python 2 dependencies, or will removing the entire Python 2 system from my machine hurt it somehow?

Thanks in advance.


I'm wondering if the easiest and cleanest option is to just completely remove Python 2 from my machine.

Don't go there. Please don't remove system binaries such as Python or Ruby. They come installed in /System/Library/Frameworks and I wouldn't be surprised if your system malfunctioned in some way after forcefully removing things from there at will.

It's anything but "clean" to delete something your system shipped (and was designed to work) with. This is especially important because Python 3 is not backwards compatible to Python 2, IIRC.

If you want to install newer versions of Python, there are other ways to go about it. One would be to use the Python installer, which adds the new version to the Frameworks, and provides you with python3.

The other would be to use a package manager such as Homebrew. After installing that, you can run brew install python3, which will install to /usr/local/ instead of overwriting any system binaries. You'll also get a python3 binary.

If you want to work with python3 instead of Python 2's python, simply add this alias to your ~/.bash_profile:

alias python='python3'