Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Completely Uninstall Python on Your Mac

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

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

  1. Open Terminal.
  2. Run which python3 and which 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).
  3. Also run brew list | grep python to see if Homebrew installed it. If you see python@3.x, it was installed via Homebrew.
  4. 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)

  1. In Terminal, run brew uninstall --ignore-dependencies python3 (replace python3 with the exact package name if different, like python@3.11).
  2. Run brew autoremove to remove now-unused dependencies.
  3. 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

  1. Open Finder and go to Applications. Drag the Python folder (e.g., “Python 3.12”) to the Trash.
  2. 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
  3. Remove the symlinks in /usr/local/bin that point to Python. Run this command to list them first:
    ls -la /usr/local/bin | grep python
    Then remove each one with sudo rm /usr/local/bin/python3 (repeat for each symlink, e.g., python3.12, pip3, etc.).
  4. Remove the receipt files that the installer left:
    sudo rm -rf /Library/Receipts/Python*

Step 4: Remove Python's Configuration and Cache Files

  1. In Finder, press Cmd+Shift+G and type ~/Library, then press Enter.
  2. Look for folders named Python or files like python.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
  3. 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

  1. Open your shell configuration file. If you use zsh (default on modern macOS), it's ~/.zshrc. If you use bash, it's ~/.bash_profile or ~/.bashrc.
  2. Look for lines that add Python to your PATH, like export PATH="/Library/Frameworks/Python.framework/Versions/3.12/bin:$PATH". Delete those lines.
  3. Save the file and run source ~/.zshrc (or the equivalent) to refresh your shell.

Step 6: Verify Python is Gone

  1. Close and reopen Terminal (or run hash -r to clear the command cache).
  2. Run which python3 and python3 --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).
  3. 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/python3 for 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.txt in 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 pyenv to avoid future uninstall headaches.
  • Use sudo only 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.