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.

- 565
- 1
- 6
- 26
-
Have you looked at your bash profile? – cer Mar 10 '16 at 16:54
-
I have followed _every_ guide. My bash profile is clean. – Pedro Carvalho Mar 10 '16 at 16:57
-
1Try typing `which -a python` What do you see? Are you trying to replace the system Python? -- not a great idea... – dawg Mar 10 '16 at 16:58
-
/usr/bin/python and /usr/local/bin/python – Pedro Carvalho Mar 10 '16 at 17:00
-
Yes I'm trying to replace the system Python. Why not a great idea? – Pedro Carvalho Mar 10 '16 at 17:01
-
2Not a good idea because many system supplied programs could use it, and they will not have been tested on the new version. In addition some might be written in C which should be linked with the version specific libraries. – cdarke Mar 10 '16 at 17:11
-
1Not a great idea because you will confuse OS X updates in the future. Also, the system Python in OS X is a framework and cannot be removed entirely. You should just install the newer version of Python in its own location and change your PATH or do an alias to have your new version execute instead of the system version. – dawg Mar 10 '16 at 18:30
3 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.

- 136
- 1
- 3
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'

- 350
- 1
- 5
-
I want to actually uninstall it completely, not just use a different version. – Pedro Carvalho Mar 10 '16 at 17:00
-
I see! Maybe it can help you out: http://stackoverflow.com/questions/3819449/how-to-uninstall-python-2-7-on-a-mac-os-x-10-6-4 – Matheus Marsiglio Mar 10 '16 at 17:02
-
As I've said, I followed every guide, including that one. It was not enough. – Pedro Carvalho Mar 10 '16 at 17:05
-
1This is not the correct answer. Pedro wants to UNINSTALL not to rename his actual version – acostela Mar 10 '16 at 17:06
-
@PedroCarvalho if this way is not working, I truly believe that something is wrong. Did you try as root user? – Matheus Marsiglio Mar 10 '16 at 17:20
-
I did. Removing all python-related things from /usr/local/bin and /usr/bin did it. – Pedro Carvalho Mar 10 '16 at 17:32
-
Voted down because the answer is not only off topic but misleading. Setting an alias will only tell the respective shell session that, inside that session, `python` == `/usr/bin/python3.4` - which is very different to having programs be built using that Python version. See the difference between symbolic linking and aliases explained here: http://stackoverflow.com/questions/18452596/whats-the-difference-between-ln-s-and-alias – GrayedFox Dec 09 '16 at 15:35
Agree with the accepted answer that uninstalling is a bad idea, but for those of you using HomeBrew to install your own Python, you don't need an alias as in @Mat Marsiglio's answer. Rather you can do what the HomeBrew installation suggestions:
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
This gives brew's python precedence over the built-in one at /usr/bin/python

- 8,577
- 15
- 49
- 70