Uninstall Python on Mac
How to uninstall Python on a Mac. Removing Homebrew Python, the python.org installer, or pyenv- and uv-managed versions, and why you must never delete the system Python from macOS.
Important: do not delete the system Python. It does not come with macOS. It arrives with the Xcode Command Line Tools, and Apple's own developer utilities depend on it. Removing it, or removing /usr/bin/python3, can break parts of the operating system, and it is not straightforward to put back. The system Python lives in /usr/bin/ and /Library/Developer/CommandLineTools/. Leave both alone.
If the system Python is bothering you because the wrong python runs when you type it, adjust the Mac Python PATH.
This is just one step in setting up your Mac for development. See the complete Mac setup checklist.
Before you get started
You'll need a terminal application to uninstall Python. Apple includes the Mac terminal but I prefer Warp Terminal. Warp increases developer productivity, helping you remember easily-forgotten commands and adds AI troubleshooting. Download Warp Terminal now; it's FREE and worth a try.
First, find out what you actually have
Removing the wrong Python is the most common way this goes wrong, so identify each installation before you delete it:
$ which -a python3
/opt/homebrew/bin/python3
/usr/bin/python3
/Users/daniel/.local/bin/python3
$ which -a python
/Users/daniel/.local/bin/python
The which -a command lists every python3 or python on your PATH, in the order macOS will pick them. Read the paths to tell them apart:
/usr/bin/is Apple's system Python. Never remove it./Library/Developer/CommandLineTools/is the Xcode Command Line Tools Python. Never remove it./opt/homebrew/or/usr/local/Cellar/is Homebrew Python. Remove it withbrew uninstall, described below. Do not delete files here by hand, because Homebrew keeps its own record of what it installed and deleting files leaves that record wrong. Note that/opt/homebrew/is Homebrew itself, not just its Python./Library/Frameworks/Python.framework/is the python.org installer. Remove one version folder from insideVersions/, described below. Deleting the wholePython.frameworkfolder removes every python.org version at once, which is rarely what you want..pyenv/versions/holds pyenv-managed versions. Remove one withpyenv uninstall, described below. Each version is its own folder insideversions/.~/.local/bin/is not a Python installation. It holds symlinks that point elsewhere. The uv utility putspython,python3, and a version-numbered link here so you can run Python without typinguv runfirst. The directory is a general-purpose location for user-installed commands, so other tools use it too. Do not delete these links to uninstall Python. Removing a link leaves the Python it points to still on your disk.~/.local/share/uv/is where a uv-managed Python actually lives. Remove it withuv python uninstall, described below.
For more detail on telling these apart, see Check if Python is installed.
Uninstall Homebrew Python
Homebrew is the quick and easy way to install Python from the command line. It is useful for quick scripts or running an application but not ideal for work on more than one Python programming project.
You have a Homebrew Python if which -a python3 lists a path inside Homebrew's own folder:
$ which -a python3
/opt/homebrew/bin/python3
On an Intel Mac the path is /usr/local/bin/python3 instead, because Homebrew installs into /usr/local. That is the same folder the python.org installer uses, so on an Intel Mac follow the link to tell the two apart. A Homebrew link points into a Cellar folder:
$ readlink $(which python3)
../Cellar/[email protected]/3.14.3_1/bin/python3
Homebrew installs Python as a versioned formula, such as [email protected] or [email protected]. List what you have:
$ brew list --formula | grep python
Then remove the one you want:
$ brew uninstall [email protected]
Important: expect this to fail if something else needs it. Homebrew installs Python automatically as a dependency of many other formulae, so brew uninstall will refuse rather than break them. Check what depends on it first:
$ brew uses --installed [email protected]
If that lists anything, you have a choice: remove those formulae too, or leave Python where it is. Forcing the issue with --ignore-dependencies will leave the dependent formulae broken, so avoid it unless you know exactly what you are doing.
Uninstall the python.org version
The official downloadable Python installer is designed to put Python on macOS for a non-developer. The Python 3.x folder doesn't actually contain a Python executable, just a symlink and IDLE, Python's built-in, lightweight graphical code editor/IDE, and pip, the package manager for Python so a user can install third-party libraries.
You have a python.org Python if which -a python3 lists /usr/local/bin/python3 and that link points into the Python framework:
$ which -a python3
/usr/local/bin/python3
$ readlink /usr/local/bin/python3
/Library/Frameworks/Python.framework/Versions/3.14/bin/python3
The /Library/Frameworks/ part is what identifies it. If the link points into a Cellar folder instead, you are looking at a Homebrew Python on an Intel Mac, so use the Homebrew steps above.
The python.org installer puts three things on your Mac, all of which must be removed to uninstall.
First, remove the framework, which holds Python itself:
$ sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.14
Second, remove the applications Python folder, which holds IDLE and the Read Me:
$ sudo rm -rf "/Applications/Python 3.14"
Third, remove the symlinks the installer left in /usr/local/bin/. Find them before deleting, because other things also live in that directory:
$ ls -l /usr/local/bin | grep -i '/Library/Frameworks/Python.framework'
Remove only the links that resolve into the framework you just deleted.
Substitute your own version number for 3.14. If you have several versions, delete only the Versions/ directory you actually want gone. Deleting the whole Python.framework removes every python.org version at once.
Finally, the installer added a PATH entry to your shell profile. Open ~/.zprofile and remove the block that mentions Python.framework, or it will linger as a dead link. See Mac PATH for Python.
Uninstall a pyenv Python version
Pyenv is an older command-line tool that lets you install, manage, and switch between multiple versions of Python. Most developers now prefer the uv utility for managing Python versions.
You have a pyenv Python if which -a python3 lists a path in the pyenv shims folder:
$ which -a python3
/Users/username/.pyenv/shims/python3
A shim is a small stand-in program, not Python itself. It works out which version you have selected and hands the command to that version, which is why the path says shims rather than naming a version.
To remove a single version:
$ pyenv versions
$ pyenv uninstall 3.12.1
To remove pyenv itself along with every Python version it installed, delete its root directory:
$ rm -rf $(pyenv root)
Then remove the pyenv init lines from your shell startup file (~/.zshrc or ~/.zprofile), and remove the pyenv package:
$ brew uninstall pyenv
Important: leaving the pyenv init lines behind after deleting the root is what produces a shell that errors on every new terminal window. Remove the configuration lines, not just the directory.
Uninstall a uv-managed Python version
The uv utility is a modern, fast Python version manager. It is an all-in-one tool that is the modern standard for Python development. It keeps its Python builds separate from everything else, so removing one affects nothing outside uv.
You have a uv-managed Python if which -a python3 lists a path in ~/.local/bin that points into uv's own storage folder:
$ which -a python3
/Users/username/.local/bin/python3
$ readlink ~/.local/bin/python3
/Users/username/.local/share/uv/python/cpython-3.13.3-macos-aarch64-none/bin/python3.13
The link in ~/.local/bin is only a pointer. The Python itself lives under ~/.local/share/uv/, which is why you remove it with the uv command below rather than by deleting the link.
Check which Python versions uv has installed:
$ uv python list --only-installed
Find which Python version uv will use by default:
$ uv python find
Check where uv stores Python installations:
$ uv python dir
To delete a specific Python version installed by uv:
$ uv python uninstall 3.14
Python uv versions are pre-built, standalone Python distributions so installs are fast and don't require system build tools. The tool uv keeps Python versions in ~/.local/share/uv/python/. Each version is self-contained and does not interfere with other installations.
To remove uv itself as well, see the uninstall section of Install uv on Mac.
After uninstalling
Open a new terminal window (the old one still has the deleted paths cached). Check what is left:
$ which -a python
$ python --version
If you now get zsh: command not found: python, you removed the last Python on your PATH. That is expected if you meant to remove everything. If not, see command not found: python.
If the wrong version runs, nothing is broken. Your Mac PATH for Python just needs reordering.
Reinstalling
If you are clearing out a tangled setup to start fresh, uv is the easiest one to keep tidy, because it stores every version in one directory and removes them with a single command.
- How to install Python on Mac covers which method to choose.
- Download Python for Mac is for the official installer.
Continue setting up your Mac
Don't miss the full visual roadmap and checklist that shows how to set up a Mac for software development, with all the essential tools and settings you might not yet know about.