How to uninstall Python via Homebrew on Mac

Before uninstalling Python, make sure you don’t have any other applications that rely on it. You might also want to check whether you have any important data files or information that use Python. It is safe to have a backup of your important data files using Python.

To uninstall Python via Homebrew on a Mac, you will need to follow these steps:

Open the Terminal application on your Mac.

To see a list of all the packages that are currently installed on your system via Homebrew, run the command brew list. This will help confirm that Python is indeed installed via Homebrew.

Run brew uninstall python command in the terminal:

brew uninstall python

The output of the above command will be like this:

Uninstalling /opt/homebrew/Cellar/python@3.10/3.10.9… (3,110 files, 57.1MB)

This will remove the Python package and any dependencies it may have installed. You can run brew list python command to verify that the python has been uninstalled on the MAC’s machine.

brew list python

You should receive the following message if the python has been uninstalled as a homebrew package: Error: No such keg: /opt/homebrew/Cellar/python

Please note that if you have installed any python packages via pip, they will not be removed by this command and you may need to remove them separately.

If you want to remove older versions of Python that were installed via Homebrew, run the brew uninstall –ignore-dependencies python command:

brew uninstall --ignore-dependencies python

If you have installed Python in a location that is included in your system’s PATH, you can remove Python from the path by using the sudo rm /usr/local/bin/python command.

sudo rm /usr/local/bin/python

Run the command brew cleanup to clear out old files and free up disk space.

brew cleanup

The output will be like this:

==> This operation has freed approximately 2.2MB of disk space.

Running python command in the terminal


should show you the zsh: command not found: python message now which signifies that the Python has been uninstalled.