How to Completely Uninstall Python on Your Mac
In this article
To completely uninstall Python on your Mac, you need to remove the Python framework, the symlinks in /usr/local/bin, and any leftover configuration files. Simply deleting the app from Applications is not enough, because Python installs deep into your system. Before you start, back up any scripts or virtual environments you want to keep, and note that this guide covers Python installed via the official installer from python.org, Homebrew, and the system Python that ships with macOS (though you cannot remove the system one safely).
What You'll Need
- Administrator (admin) access to your Mac — you'll need to enter your password for some steps.
- Terminal app (found in Applications > Utilities).
- Time and patience — removing all traces takes a few minutes.
- A backup of any Python files you want to keep (scripts, projects, virtual environments).
Step-by-Step
Note: Menu and file names can vary slightly depending on your macOS version and how Python was installed. The steps below cover the most common methods.
Step 1: Identify How Python Was Installed
- Open Terminal.
- Run
which python3andwhich python(if it exists). The output will show a path like/usr/local/bin/python3(official installer or Homebrew) or/usr/bin/python3(system Python). - Also run
brew list | grep pythonto see if Homebrew installed it. If you see python@3.x, it was installed via Homebrew. - Check Applications for a Python folder (e.g., “Python 3.12”) — that indicates the official installer.
Step 2: Remove Python Installed via Homebrew (if applicable)
- In Terminal, run
brew uninstall --ignore-dependencies python3(replacepython3with the exact package name if different, likepython@3.11). - Run
brew autoremoveto remove now-unused dependencies. - If you also installed Python via the official installer, continue to the next step; otherwise skip to Step 4.
Step 3: Remove the Official Python Installer Files
- Open Finder and go to Applications. Drag the Python folder (e.g., “Python 3.12”) to the Trash.
- Open Terminal and run the following command to remove the Python framework (adjust the version number to match what you have):
sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.12 - Remove the symlinks in
/usr/local/binthat point to Python. Run this command to list them first:
ls -la /usr/local/bin | grep python
Then remove each one withsudo rm /usr/local/bin/python3(repeat for each symlink, e.g.,python3.12,pip3, etc.). - Remove the receipt files that the installer left:
sudo rm -rf /Library/Receipts/Python*
Step 4: Remove Python's Configuration and Cache Files
- In Finder, press Cmd+Shift+G and type
~/Library, then press Enter. - Look for folders named
Pythonor files likepython.cfg. Delete anything related to Python that you find in the following locations (if they exist):
~/Library/Python— this holds user-specific Python data.~/Library/Application Support/Python~/Library/Caches/pip— pip cache.~/Library/Logs/Python
- Also check
/Library/Python(system-wide) and remove any Python-related items there, but be careful not to delete the system Python in/usr/bin.
Step 5: Remove Python from Your Shell Profile
- Open your shell configuration file. If you use zsh (default on modern macOS), it's
~/.zshrc. If you use bash, it's~/.bash_profileor~/.bashrc. - Look for lines that add Python to your PATH, like
export PATH="/Library/Frameworks/Python.framework/Versions/3.12/bin:$PATH". Delete those lines. - Save the file and run
source ~/.zshrc(or the equivalent) to refresh your shell.
Step 6: Verify Python is Gone
- Close and reopen Terminal (or run
hash -rto clear the command cache). - Run
which python3andpython3 --version. If you see “command not found” or a path to/usr/bin/python3, the uninstall was successful (the latter is the system Python, which you can't remove). - Run
pip3 --version— it should also return “command not found”.
Common Mistakes
- Deleting only the Applications folder: This leaves the framework and symlinks behind, so Python still runs from the command line.
- Forgetting Homebrew: If you installed Python via Homebrew, removing the official installer files won't remove the Homebrew version.
- Deleting the system Python: macOS depends on
/usr/bin/python3for some system tools. Do not delete it — it's protected by SIP (System Integrity Protection) anyway. - Not checking your shell profile: Even after deleting files, your PATH may still point to the old Python, causing errors.
Tips
- Before uninstalling, use
pip freeze > requirements.txtin each of your projects to save installed packages so you can reinstall them later. - If you plan to reinstall Python, consider using a version manager like
pyenvto avoid future uninstall headaches. - Use
sudoonly when necessary — it can be dangerous if you mistype a path. - If you want to keep some Python scripts but remove the interpreter, move those scripts to a folder outside of Python's directories.
Troubleshooting
“python3” still works after uninstall
If which python3 still shows a path, you likely missed a symlink or the Homebrew installation. Re-run the steps for the method you used. Also check /opt/homebrew/bin if you're on an Apple Silicon Mac — Homebrew installs there.
“pip3” is not found but “python3” is
This usually means you removed the symlinks for pip but not for Python. Run ls -la /usr/local/bin | grep pip and remove any remaining pip symlinks.
Permission errors when deleting files
Make sure you use sudo for system-wide locations (/Library, /usr/local). If you still get errors, check if the file is locked (right-click > Get Info > uncheck Locked).
Your shell shows “command not found” but Python still runs
This can happen if you have a leftover alias or function in your shell profile. Check ~/.zshrc (or ~/.bash_profile) for lines that define python or python3 and remove them.
You accidentally deleted the system Python
This is unlikely due to SIP, but if you see errors from system tools like xcrun or git, you can restore the original Python by reinstalling the Command Line Tools: run xcode-select --install.
Frequently Asked Questions
Can I remove the system Python that comes with macOS?
No. The system Python at /usr/bin/python3 is part of macOS and is protected by System Integrity Protection. Attempting to remove it can break system tools. It's best to leave it alone.
Will uninstalling Python delete my Python scripts?
No, uninstalling the interpreter does not delete your script files. However, if your scripts are inside the Python installation folder (e.g., /Library/Frameworks/Python.framework), they will be deleted. Always back them up first.
How do I know if Python was installed via Homebrew or the official installer?
Run brew list | grep python — if you see a package, it's Homebrew. Also, the official installer creates a folder in Applications named “Python X.Y”. The path /usr/local/bin/python3 can be either, but Homebrew often uses /opt/homebrew/bin on Apple Silicon.
Do I need to uninstall Python if I want to upgrade to a newer version?
No, you can install multiple versions side-by-side. However, if you want a clean slate, uninstall the old version first, then install the new one.
What is the easiest way to uninstall Python on a Mac?
If you installed it via Homebrew, brew uninstall python3 is the simplest. For the official installer, you need to manually delete the framework and symlinks as described above.
Will uninstalling Python affect other programs like Git or Node.js?
No, those tools do not depend on Python. However, some command-line tools (like aws or pipx) might use Python — check their documentation if they stop working.