Home > How to Tips

How to Uninstall Python from Mac via Terminal, Finder, Homebrew?

Updated on Friday, December 13, 2024

iBoysoft author Jenny Zeng

Written by

Jenny Zeng
Professional tech editor

Approved by

Jessica Shee

English Français Deutsch やまと Español Português

Summary: This article from iBoysoft covers four ways to completely uninstall Python from Mac. You'll learn how to uninstall Python using Terminal, Finder, a dedicated app uninstaller, and Homebrew. To quickly delete Python from your Mac, use CleanMyApp.

How to uninstall Python on Mac

Python is a popular programming language known to all developers and people into developing. If you don't need Python anymore, you'll probably remove its app and empty the Trash, thinking it's gone for good. However, removing the program file doesn't fully delete the app. There are still folders or files relevant to Python scattered on your Mac.

Fortunately, there are several ways to completely uninstall Python from Mac. Here's a summary:

How to uninstall Python from MacDifficulty Level
Uninstall Python with uninstallerLow, remove multiple Python versions from Mac with a few clicks
Remove Python on Mac manuallyMedium, need to go through different folders to locate related service files
Delete Python from Mac in TerminalHigh, require command-line knowledge
Uninstall Python using HomebrewLow, for Python installed with Homebrew

Uninstall Python from Mac via uninstaller (Easiest)

The fastest way to uninstall Python on Mac is using the dedicated app uninstaller, CleanMyApp. It can automatically find and remove all service files (like supporting files, cache files, log files, preferences, sandbox files, and status files) of a selected application from Mac.

It also supports batch uninstalling apps with a few clicks. Follow the steps below to fully remove Python on Mac:

Step 1: Download and install CleanMyApp from the Mac App Store.

Step 2: Launch the uninstaller, select Python Launcher and IDLE, then click Uninstall.

How to uninstall Python on Mac with an uninstaller

Step 3: Confirm the action by clicking "Continue uninstall." (You may need to enter your password to allow the action.)

Confirm to uninstall Python

Step 4: Once Python is uninstalled, click Finish.

Remove Python from Mac Completely in Finder (Hardest)

You can manually uninstall all Python versions on Mac using Finder, the file management software on Mac. The process involves three parts: closing all running processes of Python, removing its program file, and deleting all service files. Here's how:

  1. Quit Python on your Mac.
  2. Open Activity Monitor and search for Python-related processes.
  3. If any, select it, click the x icon, and choose Quit to kill the process.
  4. After ensuring all of its background processes are killed, go to the Applications folder in Finder.
  5. Right-click on the Python folder and select "Move to Trash."
    Delete the Python app from the Applications folder
  6. Make sure Finder is active, then click Go > Go to Folder from the menu bar.
    How to open Go to Folder
  7. Enter the following paths one by one and delete the said file or folder. (If there's no such file, skip it.)
    ~/Library/Frameworks/Python.framework
    ~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.python.idle.sfl
    ~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.python.pythonlauncher.sfl
    ~/Library/Saved Application State/org.python.IDLE.savedState
    ~/Library/Saved Application State/org.python.PythonLauncher.savedState
    ~/Library/Preferences/
    ~/Library/Application Support/CrashReporter/
    ~/Library/Caches/
  8.  Keep going to delete hidden files.
  9. Open Macintosh HD in Finder.
  10. Press Command + Shift + . to reveal hidden files.
  11. Navigate to private/var/db/receipts.
  12. Remove all files associated with Python.
    How to delete hidden files of Python from Mac
  13. Empty the Trash.

This is how to completely uninstall Python from Mac in Finder. Share to benefit others!

 

Uninstall Python on Mac from Terminal (Commands required)

Alternatively, you can uninstall Python from your MacBook or desktop Mac using the Terminal app. If you're not familiar with command lines, read the instructions carefully before taking action.

  1. Ensure your account has administrative privileges.
  2. Open Terminal. (Press Command-Space, then type Terminal and choose the right option.)
  3. Type the command below and hit Enter to delete the Python app. Replace version_number with your version of Python.
  4. sudo rm -rf /Applications/Python\ version_number/For example, sudo rm -rf /Applications/Python\ 3.13/How to remove Python from Mac in Terminal
  5. Type your login password and hit Enter.
  6. Delete the frameworks.sudo rm -rf /Library/Frameworks/Python.framework/Versions/version_numberHow to delete Python frameworks in Terminal
  7. Check if there are symbolic links.ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/version_number'How to list symbolic links of Python in Terminal
  8. Delete these symbolic links.cd /usr/local/binls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/version_number' | awk '{print $9}' | tr -d @ | xargs rmDelete symbolic links of Python in Terminal
  9. Empty the Trash.

If you have multiple Python versions, these steps should allow you to uninstall all Python versions on Mac.

Share to help others uninstall Python in Mac Terminal!

 

Delete Python from Mac using Homebrew (If installed by Homebrew)

If you installed Python with Homebrew, it's easy to uninstall. Follow the steps below:

  1. Open Terminal.
  2. Run the command below after replacing version_number to uninstall Python.brew uninstall python@version_numberIf you want to Python 3.8.5 on Mac, change the command to: brew uninstall [email protected]
  3. Clean up Python on Mac.brew cleanup python@version_number

These are the four ways to uninstall Python on MacBook or desktop Mac.

Share this article if it's helpful!