Smart Systems for Home

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

How to Uninstall Python on Mac (Complete Guide)

· 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 uninstall Python on a Mac, you need to remove the Python framework, the symbolic links in /usr/local/bin, and any leftover files in ~/Library. The exact steps depend on whether you installed Python from the official python.org installer, Homebrew, or the Mac App Store. This guide covers all three methods and includes cleanup steps to avoid leaving broken links or orphaned files.

What You'll Need

  • Admin access to your Mac (you'll need to enter your password for some commands).
  • A terminal app (Terminal.app is fine).
  • If you installed Python via Homebrew, you'll need Homebrew installed (check with brew --version).
  • If you installed from the python.org installer, you'll need the original installer package or just the terminal commands below.
  • Optional: a backup of any Python scripts or virtual environments you want to keep.

Step-by-Step

Note: Menu names and file paths can vary slightly by macOS version and Python version. The steps below are for the current official releases as of this writing.

Method 1: Uninstall Python Installed from python.org (Official Installer)

  1. Open Terminal (found in /Applications/Utilities/).
  2. Check which Python versions you have installed. Run: ls /Library/Frameworks/Python.framework/Versions/ – this shows the version folders (e.g., 3.9, 3.10, 3.11).
  3. Remove the entire Python framework. Run: sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.11 (replace 3.11 with your version). If you have multiple versions, repeat for each.
  4. Remove the symbolic links in /usr/local/bin that point to Python. Run: cd /usr/local/bin && ls -la | grep "Python" to see them. Then remove each with sudo rm /usr/local/bin/python3.11 (and similarly for pip3, idle3, etc.).
  5. Remove the Python application directory (if present). Run: sudo rm -rf /Applications/Python 3.11 (the folder name includes the version).
  6. Remove the receipt files so macOS doesn't think Python is still installed. Run: sudo rm -rf /Library/Receipts/Python* – this removes all Python-related receipts.
  7. Clean up user-level files. Run: rm -rf ~/Library/Python and rm -rf ~/Library/Caches/org.python.python (this deletes user-installed packages and caches).
  8. Optional: check for any remaining references. Run: which python3 – if it returns nothing, the uninstall is complete.

Method 2: Uninstall Python Installed via Homebrew

  1. Open Terminal.
  2. List installed Python formulae: brew list | grep python – this shows packages like python@3.11 or python@3.9.
  3. Uninstall each one. Run: brew uninstall python@3.11 (replace with your version). If you want to remove dependencies that are no longer needed, run brew autoremove after.
  4. Clean up the Homebrew cache: brew cleanup – this removes old downloads.
  5. If you installed Python via the Homebrew installer but also have a python.org installation, the Homebrew uninstall does not remove the framework from /Library/Frameworks. You'll need to follow Method 1's steps 3-7 to remove that.

Method 3: Uninstall Python from the Mac App Store

  1. Open the App Store app on your Mac.
  2. Click your name in the bottom-left corner (or go to the Updates tab and click your account icon).
  3. Find Python in your list of purchased apps. Click the “X” button next to it to delete it. If you don't see an “X”, you may have installed it via a different method.
  4. After deleting, check for leftover files in /Library/Frameworks or ~/Library – App Store apps usually don't leave these, but it's safe to check.

After Uninstalling: Verify Removal

  1. Run which python3 and which python in Terminal. If they return nothing, the command-line tools are gone.
  2. Run ls /Library/Frameworks/Python.framework – if you get “No such file or directory”, the framework is removed.
  3. If you still see a python3 command, it might be from Apple's command line tools (Xcode CLT). To remove that, you'd need to uninstall the CLT, but that's separate – Apple's python3 is not the same as a full Python installation.

Common Mistakes

  • Only deleting the app from /Applications: This leaves the framework and symlinks behind, which can cause confusion later.
  • Using sudo rm -rf /Library/Frameworks/Python.framework without specifying the version: This removes all versions, which may be fine, but if you only wanted one version, you'll lose them all.
  • Not removing the symlinks: Broken symlinks in /usr/local/bin can cause “command not found” errors or point to nothing.
  • Forgetting about pip: If you have pip installed as a separate package, you may need to remove it too. Usually pip is part of Python, but if you installed pip separately, check with which pip3.
  • Not checking for virtual environments: Virtual environments contain symlinks to the Python binary. If you delete Python, those environments become broken. You should delete them or recreate them.

Tips

  • Before uninstalling, make a list of any Python packages you use (run pip3 list) so you can reinstall them later if needed.
  • If you're uninstalling to fix a broken Python installation, consider reinstalling the same version first – sometimes a clean reinstall fixes issues without removing everything.
  • Use sudo carefully – only run commands you understand. If you're unsure, copy-paste the exact commands from this guide.
  • If you have multiple versions, uninstall them one by one, starting with the oldest, to avoid breaking dependencies.
  • After uninstalling, check your PATH in ~/.zshrc or ~/.bash_profile for any references to Python paths and remove them.

Troubleshooting

If you get “Permission denied” errors: You need to use sudo for system-level files. If you're already using sudo and still get errors, check that you're typing the correct path.

If which python3 still shows a path after uninstall: It might be from Apple's Command Line Tools. To check, run ls -l $(which python3) – if it points to /Library/Developer/CommandLineTools, it's not your Python installation. You can leave it or uninstall the CLT separately (not recommended unless you know you don't need them).

If Homebrew uninstall fails with “No such keg”: The formula might be named differently. Run brew list | grep python to see the exact name.

If you get “Operation not permitted” on macOS Catalina or later: This is often due to System Integrity Protection (SIP). You may need to restart your Mac in Recovery Mode and disable SIP temporarily, but that's risky – only do it if you're confident. Alternatively, you can leave the files in place; they won't cause harm.

If the App Store shows “Update” instead of “X”: You might have the app installed via a different method. Check /Applications for a Python folder – if it's there, use Method 1.

Frequently Asked Questions

Do I need to uninstall Python if I want to upgrade to a newer version?

No, you can install a newer version alongside the old one. macOS can handle multiple Python versions. If you want to replace the old one, uninstall it first, then install the new one.

Will uninstalling Python break my system?

No, macOS does not rely on Python for core functionality. Some third-party tools might rely on it, but you can reinstall it later if needed.

How do I know which Python version I have?

Run python3 --version in Terminal. If you have multiple, run ls /Library/Frameworks/Python.framework/Versions/ to list them.

Can I just delete the Python folder in /Applications?

That removes the GUI app but not the command-line tools or framework. It's not a complete uninstall.

What about pip? Does uninstalling Python remove pip?

Yes, pip is part of the Python installation. If you installed pip separately via get-pip.py, you may need to remove it manually, but that's rare.

Is it safe to delete the ~/Library/Python folder?

Yes, that folder contains user-installed packages and caches. Deleting it removes those packages, but it won't affect the system.