Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstall Python 2.7 from Mac OS X El Capitan

I want to completely reinstall Python 2 but none of the guides I have found allow me to uninstall it. No matter what I do, python --version still returns 2.7.10, even after I run the Python 2.7.11 installer. All the other guides on StackOverflow tell me to remove a bunch of files, but python is still there.

like image 285
Pedro Carvalho Avatar asked Mar 10 '16 16:03

Pedro Carvalho


2 Answers

This may be a bit late, but for future searchers I'll post anyway:

I was looking to do the same. But I came across this paragraph at the Foundation (Getting and uninstalling MacPython) which convinced me to leave well alone and not uninstall it.

The Apple-provided build of Python is installed in /System/Library/Frameworks/Python.framework and /usr/bin/python, respectively. You should never modify or delete these, as they are Apple-controlled and are used by Apple- or third-party software. Remember that if you choose to install a newer Python version from python.org, you will have two different but functional Python installations on your computer, so it will be important that your paths and usages are consistent with what you want to do.

like image 53
Bagoong Avatar answered Nov 14 '22 21:11

Bagoong


Set your an alias to use the python version that you want to use from inside your .bashrc (or zsh if you use it).

Like: alias python='/usr/bin/python3.4'

like image 20
Matheus Marsiglio Avatar answered Nov 14 '22 23:11

Matheus Marsiglio