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.
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.
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'
-
I want to actually uninstall it completely, not just use a different version. Mar 10, 2016 at 17:00
-
I see! Maybe it can help you out: stackoverflow.com/questions/3819449/… Mar 10, 2016 at 17:02
-
As I've said, I followed every guide, including that one. It was not enough. Mar 10, 2016 at 17:05
-
1This is not the correct answer. Pedro wants to UNINSTALL not to rename his actual version– acostelaMar 10, 2016 at 17:06
-
@PedroCarvalho if this way is not working, I truly believe that something is wrong. Did you try as root user? Mar 10, 2016 at 17:20
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
which -a python
What do you see? Are you trying to replace the system Python? -- not a great idea...