How To Uninstall Python On MacOS

Quick Links Should you remove Python from your Mac? How to uninstall Python on macOS using Terminal How to uninstall Python on macOS using an uninstaller How to uninstall Python … Read more

Taylor Bell

Taylor Bell

Published on Jun 20, 2024

How To Uninstall Python On MacOS

Quick Links

  • Should you remove Python from your Mac?

  • How to uninstall Python on macOS using Terminal

  • How to uninstall Python on macOS using an uninstaller

  • How to uninstall Python on macOS manually

Many users opt to delete files, folders, and uninstall apps they’re not using on their Macs to clear storage and simplify lists. Usually, removing these items is simple and requires just a click or two, but sometimes the process is more complex. One popular example is Python, which certain developers install on macOS Sonoma to run relevant scripts. But, what if you’re done with Python and want to remove it from your Mac? Yes, you can fully uninstall it, and we’ll run through all of the exact steps in this guide.

MacBook Air running Terminal commands

Related

How to add Python to PATH in macOS

Save time by streamlining your Python development setup in macOS.

Why is Python here?

An image showing a laptop displaying the Python Package Index website on a web browser.

Python is a popular cross-platform programming language that’s supported on macOS. While previous Mac operating systems shipped with Python installed by default, you may need to manually install Python on your Mac if you’ve purchased a newer model. Some more recent versions package what’s known as a “stub” for Python, which is essentially a placeholder. When you execute this placeholder file, it triggers a full installation of Python, which lets you use Pip on macOS and run Python scripts that can help with your daily workflows. Additionally, some development platforms require Python installation to function correctly.

Should you remove Python from your Mac?

MacBook Pro M2 Max on a table showing desktop

Let’s assume you were actively relying on Python but have now stopped doing so. Should you uninstall Python? The short answer is no. Uninstalling Python may not always be safe, and doing so might require you to reinstall macOS, as parts of the operating system rely on the stub and can break without it. Furthermore, leaving Python installed has no downside at all. Python files generally occupy no more than 100MB, and they don’t include an app icon that clutters the Launcher’s page. So, even if you leave Python installed, it shouldn’t be in your way.

Nevertheless, if you decide to uninstall Python on macOS, you can follow the steps below at your own risk.

How to uninstall Python on macOS using Terminal

While we advise you not to uninstall Python, you can do so by following these steps on your Mac:

  1. Launch the Terminal app.
  2. Enter which python3 and hit the return button.
  3. Make a note of your Python version number (displayed after /Versions), as well as the entire address displayed in the Terminal, since you will replace the [version number] and [address above] with the actual number and address in the following command, as well as remove “/bin/python3” from the command line.
    Screen showing the

  4. Enter sudo rm -rf[addressabove[addressabove[addressabove[addressabove] and hit return. For this example, the command is sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.9.6. Again, do not include /bin/python3“.
    Running a terminal command on macOS to uninstall python

Python and all its relevant files should now be wiped from your Mac without causing irreversible damage to macOS. This should return your Mac to its stock configuration in relation to Python, complete with stub. However, any attempt to invoke the python3 command will prompt the user to install Python again, which you can install as part of Xcode.

How to uninstall Python on macOS using an uninstaller

If you want a turnkey solution to your Python predicament, third-party uninstallers can help. Many programs that uninstall Mac apps can also uninstall Python. Usually, all you have to do is follow the onscreen instructions. Here’s a basic rundown of the steps you will have to take if you go this route:

  1. Launch your uninstaller of choice.
  2. Select Python. Depending on the uninstaller you use, you might also have to select all of its related files in a separate panel or dropdown menu.
  3. Click the Uninstall or Remove button, whichever is applicable.

Depending on the program you use, the uninstaller might remove all Python files from your computer or just move them to your Trash. If the latter is true, you will have to empty your computer’s Trash folder to truly rid your Mac of Python.

How to uninstall Python on macOS manually

You can also uninstall Python the old-fashioned way and just remove the relevant files by hand. However, you have to remain vigilant throughout this process since one mistake can cause some serious problems.

  1. QuitPython and make sure none of its processes are running in the background. You might need to use the Activity Monitor to do this.
  2. Open Finderthen open the Application folder.
  3. Place Python in your computer’s Trash.
  4. Do the same with all Python services in your Library folder. These can have names such as /Library/Frameworks/Python.framework and /Library/Saved Application State/org.python.IDLE.savedState.
  5. Repeat the process yet again for all Python-centric hidden files in your Users folder.
    • Before you start, make sure all hidden files are visible.
    • When deleting files, look for labels like /private/var/db/receipts/org.python.Python.PythonUnixTools-3.6.bom and /private/var/db/receipts/org.python.Python.PythonFramework-3.6.plist.

So long as you delete every instance of a Python-related folder and file, your Mac shouldn’t encounter any issues after you’re finished.

You shouldn’t uninstall Python

As indicated in our guide, while it’s possible to uninstall Python on macOS, you’re not advised to do so. Leaving Python installed will not affect your workflow in any way. Moreover, we must stress that removing Python might break the operating system and require you to reinstall a fresh copy. So, while you can uninstall the coding language, whether or not you should is a completely different matter. In our opinion, it’s better to just leave Python alone.

Partager cet article

Inscrivez-vous à notre newsletter