October 10, 2025
How to uninstall Python from Mac: A complete guide
At some point, I ended up with more than one version of Python on my Mac. Nothing dramatic, but it did cause a few small conflicts that made me wonder if I should just clean it all out. If you’ve ever been in the same boat or if you simply want to free your Mac from Python and all its traces, this guide will help.
Below, I’ll walk you through several safe ways to uninstall Python so you can pick the one that best fits your setup and needs.
This Article Contains
Things to know before removing Python
Before you start, let’s clear up a few important details so you don’t accidentally remove something your Mac actually needs.
First things first, there’s Python and there’s Python IDLE.
- Python is a programming language and runtime environment.
- Python IDLE is a lightweight app for writing and running Python code installed when you download Python from the official website.
In this article, I cover how to remove both.
Why do people remove Python?
Here are the most common scenarios where uninstalling Python makes sense:
- Cleaning up the system. Python often comes bundled with Homebrew packages, Xcode Command Line Tools, or other apps you might no longer use.
- Reinstallation or upgrade. Developers uninstall older versions when switching from, say, Python 3.11 to 3.13, to avoid clutter.
- Resolving version conflicts. If you have multiple Python versions installed, they can conflict with each other or cause confusion (as in this case of a Reddit user).
- Freeing up space. A full Python setup with modules and pip dependencies can take up hundreds of MBs.
And when it comes to Python IDLE, it often gets removed because it’s too limited for real projects, as it has no virtual environments, Git support, or advanced features. In such cases, users switch to more powerful editors like VS Code, PyCharm, Sublime Text, or beginner-friendly alternatives like Thonny.
A word of caution about macOS versions
- On macOS 12 Monterey and earlier, the system comes with Python 2.7 preinstalled. Do not remove it. It’s tied to macOS itself, and deleting it may break scripts, apps, or even the OS, as highlighted in this Stackoverflow discussion.
Starting from macOS 13 Ventura, Apple no longer ships Python by default. However:
- Installing Command Line Tools for Xcode adds Python 3.
- Some apps (Docker, Blender, etc.) also bundle Python. Deleting those versions of Python can cause those apps to malfunction.
- If Command Line Tools are causing trouble, the safe path is to uninstall the Tools completely, then reinstall them rather than ripping out Python alone.
- All the methods described below were successfully tested on macOS 15.
How you might have installed Python
On modern Macs, Python usually arrives in one of three ways:
- From the official Python website (along with IDLE).
- Via Homebrew, pyenv, or MacPorts.
- As part of Command Line Tools for Xcode or another app.
In the next section, we’ll help you check which installation method you used, as that determines how you should safely uninstall Python.
How to check how Python was installed on your Mac
Before removing Python, it’s important to confirm if Python is installed at all, which versions you have, and how they got there. This will determine the correct (and safe) way to uninstall it.
Step 1. Confirm installed versions in Terminal
- Open Terminal.
- Type the following command and press Return:
python3 –version
Copy
If you think Python 2 may still be present (on older macOS), use this command:
python2 –version
Copy
This shows which version(s) of Python are currently available on your Mac.
Later, once you uninstall Python, you can run the same command again to confirm that the version is no longer listed.
Step 2. Look for Python IDLE in Applications
- Open Finder → go to the Applications folder.
- Search for Python.
If you see the Python folder, Python Launcher or IDLE, then Python was installed from the official Python.org package. You’ll need the removal steps for that version.
If nothing is found, move on.
Step 3. Check for Homebrew installation
In Terminal, run the following command:
brew list | grep python
Copy
If you see something like python@3.13, then Python came from Homebrew. If not, continue.
Step 4. Check for pyenv Installation
Run the command:
pyenv versions
Copy
If you see a list of Python versions, they were installed via pyenv. If not, continue.
Step 5. Check for MacPorts Installation
Run the following:
port installed | grep python
Copy
If you see entries like python37, then Python was installed using MacPorts. If nothing shows, continue.
Step 6. Other Cases
If none of the above applies, Python may have been:
- Built from source → you’ll need to locate and remove it manually.
- Bundled inside another app (e.g., Command Line Tools for Xcode, Docker, Blender). In this case, don’t delete Python directly, as it may break the parent app. Uninstall (and reinstall) the parent app instead.
How to uninstall Python installed via Homebrew
If you installed Python with Homebrew (macOS package manager), you can remove it safely using a few Terminal commands.
Step 1. Open Terminal
- Go to Applications → Utilities → Terminal.
Step 2. Check installed packages
Run:
brew list
Copy
This will show all Homebrew packages installed on your Mac, including any Python versions. You might see multiple entries like python@3.11 and python@3.13.
Step 3. Identify the version to remove
Look for the Python version you want to uninstall (e.g., python@3.13).
Step 4. Uninstall the selected version
Type the following command, replacing 3.x with the actual version number:
brew uninstall python@3.x
Copy
Step 5. Verify removal
Run again:
brew list
Copy
If Python is no longer listed, the uninstallation was successful.
How to uninstall Python installed via pyenv
If you used pyenv to manage Python versions on your Mac, here’s how to remove any version you no longer need.
Step 1. Open Terminal
Step 2. Get the list of installed versions by running this command:
pyenv versions
Copy
This will display all Python versions installed via pyenv. You might see multiple entries, such as 3.11.9 and 3.13.7.
Step 3. Identify the version to remove
Find the version you want to uninstall. For example, 3.13.0.
Step 4. Uninstall the selected version
Run the following command, replacing the version number with the one you want to remove:
pyenv uninstall 3.13.0
Copy
Press y and then Enter to confirm.
Step 5. Verify removal
To make sure the version is gone, run again:
pyenv versions
Copy
If the version no longer appears in the list, it was successfully uninstalled.
How to uninstall Python installed via MacPorts
If you installed Python using MacPorts, you can remove it with just a couple of Terminal commands.
Step 1. Open Terminal
Step 2. View the list of installed versions
For this, run:
port installed | grep python
Copy
This will display all Python versions installed through MacPorts. You might see entries like python37 and python_select.
Step 3. Identify the version to remove
Review the list and decide on the Python version you want to uninstall (e.g., python37). You might also uninstall all of them one by one.
Step 4. Uninstall the selected version
Run the following command, replacing the version number with the one you want to remove:
sudo port uninstall python37
Copy
Enter your password if prompted.
Step 5. Verify removal
To confirm that the version was removed, list installed Python packages again:
port installed | grep python
Copy
If the version no longer appears, the uninstallation was successful.
How to uninstall Python IDLE on Mac via a script
If you installed Python from the official Python.org website, it comes with IDLE (a lightweight code editor). Removing it with a script is the fastest manual removal method since it does the same thing as finding and removing all related files via Finder, but handles everything in one go.
Note:
This process deletes files permanently. Before proceeding with the following instructions, make sure you don’t have Python IDLE running.
Step 1. Download the script
Save the script file uninstall_python.sh to your Downloads folder.
Note:
You can open the script in any text editor to review how it works before running it and make sure it removes only Python IDLE-related files.
Step 2. Open Terminal
Step 3. Grant execution rights
Run the following command so that you could launch it:
chmod +x ~/Downloads/uninstall_python.sh
Copy
Allow the Terminal app to access the Downloads folder if prompted.
Step 4. Run the script with admin rights
Run this:
sudo ~/Downloads/uninstall_python.sh
Copy
Enter your administrator password when prompted.
After that, the script will automatically find your installed Python version and delete all related files.
Note:
If during the uninstallation you see “Operation not permitted”, that’s OK. It means some Python-related files are also used by other processes and hence should not be removed.
In the end, you’ll see a message like “Python 3.13 and related files have been removed.”
Step 5. Remove a leftover file (if needed)
In some cases, one file named org.python.pythonlauncher.sfl3 may remain. To delete it:
- Open Finder.
- Press Shift + ⌘ + G to open the Go to folder dialogue.
Paste this path and hit Return:
~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.python.pythonlauncher.sfl3
Copy
- If the file org.python.pythonlauncher.sfl3 is present, remove it.
Step 6. Empty Trash and restart
- Empty the Trash.
- Restart your Mac to complete the removal.
How to uninstall Python IDLE with App Cleaner & Uninstaller
Note:
App Cleaner & Uninstaller can only remove app bundles from the Applications folder. That means it works for Python IDLE (installed from the official Python.org package), but it won’t remove Python versions installed via Homebrew, pyenv, or MacPorts.
If your goal is to get rid of Python IDLE quickly, this is the easiest method:
- Download and launch App Cleaner & Uninstaller.
- Search for Python and select it.
- Once selected, simply click Uninstall.
- In the Review and confirm window, click Remove.
App Cleaner & Uninstaller will remove Python IDLE and its associated service files in just a few clicks.
Final thoughts
As a bottom line, when it comes to Python as a programming language, here’s the simple rule of thumb:
- The system Python lives in /usr/bin/ (for example, /usr/bin/python or /usr/bin/python2.7). These files are part of macOS and should never be deleted.
- Your user-installed Python is usually located in a different folder, and you can manually remove it without harming your system.
And if your goal is to remove Python IDLE, the simplest solution is to use App Cleaner & Uninstaller. It handles the app bundle and related files in just a couple of clicks.
This way, you can keep your Mac free from unused versions of Python while leaving the essential system components intact.
Keep on writing, great job!|
Thanks!