How to uninstall Python 2.7 on a Mac OS X 10.6.4?
I want to completely remove Python 2.7 from my Mac OS X 10.6.4. I managed to remove the entry from the PATH variable by reverting my .bash_profile . But I also want to remove all directories, files, symlinks, and entries that got installed by the Python 2.7 install package. I’ve got the install package from http://www.python.org/. What directories/files/configuration file entries do I need to remove? Is there a list somewhere?
11 Answers 11
Do not attempt to remove any Apple-supplied system Python which are in /System/Library and /usr/bin , as this may break your whole operating system.
NOTE: The steps listed below do not affect the Apple-supplied system Python 2.7; they only remove a third-party Python framework, like those installed by python.org installers.
The complete list is documented here. Basically, all you need to do is the following:
Remove the third-party Python 2.7 framework
Remove the Python 2.7 applications directory
Remove the symbolic links, in /usr/local/bin , that point to this Python version. See them using
and then run the following command to remove all the links:
If necessary, edit your shell profile file(s) to remove adding /Library/Frameworks/Python.framework/Versions/2.7 to your PATH environment file. Depending on which shell you use, any of the following files may have been modified:
Description: It list all the links, removes @ character and then removes them.
If you installed it using the PKG installer, you can do:
which will output something like:
you can now select which packages you will unlink (remove).
This is the unlink documentation:
In my example you will type
or in one single line:
Important: —unlink is not available anymore starting with Lion (as of Q1`2014 that would include Lion, Mountain Lion, and Mavericks). If anyone that comes to this instructions try to use it with lion, should try instead to adapt it with what this post is saying: https://wincent.com/wiki/Uninstalling_packages_(.pkg_files)_on_Mac_OS_X
Trying to uninstall Python with
will not remove the natively installed Python but rather the version installed with brew .
Create the symlink to latest version
Close and open a new terminal
In regards to deleting the symbolic links, I found this to be useful.
No need to uninstall it or going crazy with symbolic links, just use an alias . I faced the same problem when upgrading to python 3.7.1.
Just install the new python version using brew install python then in your .bash_profile create an alias pointing to the new python version; like this: alias python=»/usr/local/bin/python3″ then save and run source
No need to uninstall old python versions.
Just install new version say python-3.3.2-macosx10.6.dmg and change the soft link of python to newly installed python3.3
Check the path of default python and python3.3 with following commands
«which python» and «which python3.3»
then delete existing soft link of python and point it to python3.3
Onur Güzel provides the solution in his blog post, «Uninstall Python Package from OS X.
You should type the following commands into the terminal:
sudo rm -rf /Library/Frameworks/Python.framework
ls -l . | grep ‘../Library/Frameworks/Python.framework’ | awk ‘
sudo rm -rf «/Applications/Python x.y»
where command x.y is the version of Python installed. According to your question, it should be 2.7.
WARNING: This commands will remove all Python versions installed with packages. Python provided from the system will not be affected.
If you have more than 1 Python version installed from python.org, then run the fourth command again, changing «x.y» for each version of Python that is to be uninstalled.
Note: If you installed Python using Homebrew, then you can follow the following steps, otherwise look for another solution!
To uninstall Python 2.7.10 which you installed using Homebrew, then you can simply issue the following command:
Similarly, if you want to uninstall Python 3 (which you installed using Homebrew):
If you’re thinking about manually removing Apple’s default Python 2.7, I’d suggest you hang-fire and do-noting: Looks like Apple will very shortly do it for you:
Python 2.7 Deprecated in OSX 10.15 Catalina
Python 2.7- as well as Ruby & Perl- are deprecated in Catalina: (skip to section «Scripting Language Runtimes» > «Deprecations«)
Apple To Remove Python 2.7 in OSX 10.16
Indeed, if you do nothing at all, according to The Mac Observer, by OSX version 10.16, Python 2.7 will disappear from your system:
Given this revelation, I’d suggest the best course of action is do nothing and wait for Apple to wipe it for you. As Apple is imminently about to remove it for you, doesn’t seem worth the risk of tinkering with your Python environment.
NOTE: I see the question relates specifically to OSX v 10.6.4, but it appears this question has become a pivot-point for all OSX folks interested in removing Python 2.7 from their systems, whatever version they’re running.
Uninstall Python on Mac
For some reason, you may need to remove Python interpreter. But some users face issues when trying to get rid of Python package, which is why we recommend that you read a complete and safe deletion guide on how to uninstall Python on your Mac to prevent any issue.
What is Python?
Python is an extremely simple and flexible language that allows developers to effectively solve the problems of scripting, rapid prototyping and research programming. Python began to be developed in the late eighties by the employees of the Dutch National Research Institute of Mathematics and Computer Science Guido van Rossum. Today, the support for Python is carried out by a team of developers of the same institution.
Python is used not only by IT professionals, developers and engineers but also by people involved in data mining and analytics in the field of Big Data.
Please note, Apple pre-installed and provided Python 2.7 in Mac OS X 10.8. If you use older versions of the Mac operating system but downloaded a new version of Python 3 from its official website, then you should be careful when trying to uninstall the program.
Never modify or delete files related to the pre-installed Python by Apple.
How to uninstall Python 3 manually
To uninstall Python 3 on Mac completely and safely, please follow the steps below.
- First, quit the application and close all running processes of Python in the background. This step is very important for a safe deletion of the program.
Then go to the Application folder in Finder and move Python to Trash. Please, make sure you remove the Python uninstall package entirely, not just separate files.
In our case, we have found the following files in the Library’s subfolders:
/Library/Saved Application State/org.python.IDLE.savedState
/Library/Saved Application State/org.python.PythonLauncher.savedState
Also, there are some hidden files in the User’s folder. You can view them only if you make all your hidden files visible. For this, use a free applicationFunter, which allows you to show and hide hidden files with one click.
List of Python hidden service files:
Once again, you would need to find all the service files of Python and move them to Trash. For this, you need to show hidden files using the Funter app.
But we understand that this task can be too complicated and just a waste of time because there are other ways to uninstall Python on Mac. Read on to learn more.
How to uninstall Python using Terminal
If you are familiar with the Terminal app, you can use command lines to uninstall Python from your Mac. For this, follow these steps:
- Move Python to Trash.
- Open the Terminal app and type the following command line in the window:
tanya sudo rm -rf /Applications/Python\ 3.6/
Please note, we strictly do not recommend using this uninstalling method to users who are unfamiliar with Terminal commands.
If you are looking for the fastest and safest way to uninstall Python, you’d better use a special tool App Cleaner to handle this task.
How to uninstall Python using App Cleaner & Uninstaller
App Cleaner & Uninstaller is your efficient helper to uninstall any program on Mac quickly and easily. App Cleaner & Uninstaller automatically finds all the service files of apps so that you can be sure that the app was removed on your Mac completely without leaving any traces.
Also, if you have already deleted some apps the regular way, you can check whether their service files still remain on your hard drive, and you can get rid of them with several clicks. You can download App Cleaner & Uninstaller from our website.
Video Guide – How to remove application using App Cleaner & Uninstaller
Now let’s move to the detailed steps of Python deletion with the uninstaller tool:
Launch App Cleaner & Uninstaller. In the left section of the window, you will see all the apps installed on your Mac.
Find the Python among the apps. In the right section, you can view the list of all the support files, that we were searching for manually in the first part of the article.
Then all you need do to uninstall Python is to click the Remove button and confirm the deletion.
That’s all. We hope that it helped you to uninstall Python from your Mac computer and solve your uninstall issues. Let us know if you still have questions.
App Cleaner & Uninstaller
Disable startup programs. Manage system extentions.
Uninstall applications completely.