I installed Python 3 to learn Python and quickly realized that django isn't compatible with Python 3.
How do I uninstall Python 3 on my Mac so that I can install a different version?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityPython.org has added uninstall directions to the documentation:
http://docs.python.org/3/using/mac.html
Reading this and then inspecting my install, my list of things to uninstall is:
Using Text Wranger, which can show invisible files, I browsed my home folder and I didn't see a .bash_profile, just .bash_history. So the installer only adds the reference if the Bash profile exists. (echo $path) didn't show either. (see also: https://stackoverflow.com/questions/7501678/set-environment-variables-on-mac-os-x-lion)
The installer package really should include an uninstall script.
As of April 2013 most tutorials and courses still require Python 2, so many people will need to uninstall Python 3.
brew install
whenever possible.
Dec 30, 2020 at 11:31
How did you install it? If you used an installer, then follow yoda's wise advice. Open a terminal and remove the directory /System/Library/Frameworks/Python.framework/Versions/3.0
if it exists. You should also make sure that the symlink /System/Library/Frameworks/Python.version/Versions/Current
does not point to 3.0
. If it does, then reset it to point to 2.6
or something appropriate.
/Library/Frameworks
.
/system/library
, using a superuser password provided at install time, but have normal user-privileged uninstallers. As a result, a heavily-used modern Mac (especially one that has been through a few OS upgrades) is going to have a /system/library
dir that is totally littered with junk. Is removing stuff in that dir dangerous? Sure. That doesn't mean there aren't common, good reasons to manipulate files in the directory. Just be aware.
If the python3 location is in /usr/bin/python3 then you won't be able to delete it directly, the MAc OS may throw error like “Operation not permitted” or “read only file system” etc, because Mac OS mount the system files as read only partition and use a mechanism called system integrity protection(csrutil).
To remove the file you need to do the the following steps,
This is not a programming question. You uninstall it just as you uninstall any other software on a mac! You have a couple of options
Finder>Applications>Python 3.0
(or whatever the folder is named). Right click, select Move to Trash
, empty trash. Terminal
, type sudo rm -rf /Applications/Python\ 3.0/
, enter password and you're done.Different versions of python
go in different folders. So, you can install a new version and leave v3.0
as it is. Just remember to add the new python dir to your path and remove the old one or set an alias for python
to python2.x
Next time, remember that such questions are better asked on https://apple.stackexchange.com/
3.2
for2.7
.sudo pythonselect 2.7
to switch between Python versions.