To uninstall Python on a Mac, you need to remove the Python framework, its symlinks, and any user-level configuration files. This guide explains exactly which files to delete, how to do it safely, and what to keep if you plan to reinstall later.
Why You Might Want to Uninstall Python
Python is preinstalled on macOS, but the system version is there for Apple’s own tools and scripts. Removing it can break system functionality, so most users only need to remove a separately installed Python (e.g., from python.org, Homebrew, or pyenv). Common reasons to uninstall include:
- You installed a newer Python and want to revert to the system version.
- You’re switching to a version manager like pyenv or conda and want a clean slate.
- You’re troubleshooting a broken installation and want to start fresh.
- You want to free up disk space (though Python is usually small).
What Actually Gets Installed
When you install Python from python.org, the installer places files in several locations:
- /Library/Frameworks/Python.framework/ – the main framework containing the Python interpreter and standard library.
- /usr/local/bin/ – symlinks like
python3,pip3, andidle3that point to the framework. - /Applications/Python 3.x/ – a folder with the IDLE editor and other tools.
- ~/Library/Preferences/ – plist files for Python-related apps.
- ~/Library/Python/ – user-installed packages (site-packages).
Homebrew installs into /usr/local/opt/python@3.x (or /opt/homebrew on Apple Silicon) and creates symlinks in /usr/local/bin. pyenv installs into ~/.pyenv/versions/.
Step-by-Step: Uninstall Python from python.org
If you installed Python from the official website, follow these steps:
- Open Finder and go to Applications. Drag the Python 3.x folder to the Trash.
- Open Terminal (in Utilities).
- Delete the framework folder:
sudo rm -rf /Library/Frameworks/Python.framework - Remove the symlinks in
/usr/local/binthat point to Python. You can list them withls -la /usr/local/bin | grep pythonand then remove each one, or usesudo rm /usr/local/bin/python3 /usr/local/bin/pip3(adjust for your version). - Remove the receipt files so macOS doesn’t think Python is still installed:
sudo rm -rf /Library/Receipts/Python* - Clean up your user-level files:
rm -rf ~/Library/Pythonandrm -rf ~/Library/Preferences/org.python.Python.plist - Empty the Trash.
Uninstalling Homebrew Python
If you used Homebrew, the process is simpler:
- Run
brew uninstall python@3.x(replace 3.x with your version, e.g., python@3.11). - If you want to remove unused dependencies, run
brew autoremove. - Check for leftover symlinks with
brew doctorand fix any warnings.
Homebrew does not touch the system Python, so this is safe.
What About the System Python?
macOS ships with a Python 2.7 or 3.x in /usr/bin/python. Do not delete this. Apple uses it for system scripts, and removing it can cause issues with software updates and system tools. If you want to hide it, you can rename it, but it’s not recommended. The system Python is not accessible to user-level package managers, so it’s usually left alone.
Common Problems and How to Avoid Them
Many users think they’ve uninstalled Python but still see python3 in the terminal. This usually happens because:
- You removed the symlink but not the framework, or vice versa.
- There’s another Python installation (e.g., from Xcode’s Command Line Tools) in
/usr/bin. - Your shell’s PATH still includes a directory with an old Python.
To check which Python you’re running, use which python3 and python3 --version. If it still points to something, you may need to restart your terminal or delete the specific symlink.
Frequently Asked Questions
Will uninstalling Python break my Mac?
If you only remove the python.org or Homebrew version, no. The system Python in /usr/bin remains untouched. Removing that system version can cause problems, so avoid it.
How do I completely remove Python and all its packages?
Follow the steps above for your installation type. To remove all user-installed packages, delete the ~/Library/Python directory. That’s where pip installs packages for your user.
Can I reinstall Python after uninstalling?
Yes. Download the latest installer from python.org or use Homebrew (brew install python). Your old packages will be gone, so you’ll need to reinstall them with pip.
What’s the difference between uninstalling and just removing the symlink?
Removing the symlink only stops the python3 command from working, but the framework remains. Uninstalling removes the actual files. If you only remove the symlink, you can still run Python by its full path, but it’s messy.
Do I need to uninstall before installing a new version?
No, you can have multiple Python versions installed side by side. However, if you’re having conflicts, a clean uninstall can help. Use a version manager like pyenv to avoid such issues.
Why does Python still show up after I deleted it?
Check your PATH variable and look for other installations. Run echo $PATH and which -a python3 to see all locations. You may have a leftover symlink in /usr/local/bin or a Homebrew installation you forgot about.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Unbox ASMR Codes: What They Are & How to Use5.00 min/km
- Repurposed Old Motorola Phone for Homelab?
- How to Evaluate AI Vendors for Data Security, Privacy & Compliance
- Best Ergonomic Mouse: Top Picks & Buying Guide
- What Google Knows About You: Data Explained
- Close Tabs on Mac: Shortcuts & Methods