Migrate to RunxBuild and earn up to $50 in hosting credit on your first deposit.

Calculate your savings
unxBuild

Uninstall Python Cleanly: The Version You Can Remove, and the One You Must Not

Sean

Platform Writer

Jul 18, 2026
6 min read

How you uninstall Python depends on the operating system and how it got installed - and the most important rule is what not to touch. On Windows, use Apps and Features or the installer. On macOS, remove a python.org install by hand or a Homebrew one with brew uninstall. On Linux, do not remove the system Python - core OS tools depend on it, and deleting it can break your package manager and leave the system unusable. Remove the Python you installed for yourself; leave the one the OS ships with alone.

Uninstall Python Cleanly: The Version You Can Remove, and the One You Must Not

The reason this question is dangerous rather than routine is that Python is not one program on your machine. There is the version the OS depends on and the versions you added, and the same uninstall Python instinct that is harmless for one is destructive for the other.

Table of contents

First, know which Python you are removing

Before uninstalling anything, find out what you have and where it came from:

which -a python3        # every python3 on your PATH (Windows: where python)
python3 --version
ls /usr/bin/python*     # the system versions

A path under /usr/bin is the system Python - handled by the OS, and not something to remove by hand. A path under /usr/local, a Homebrew directory, /Library/Frameworks (macOS), or a pyenv directory is one you installed and can remove safely.

This check is the whole safety mechanism. The difference between a clean uninstall and a broken operating system is entirely about which Python you delete. Two minutes identifying the source of each installed version tells you exactly what is safe to touch and what is off limits.

Windows: Apps and Features

Windows is the straightforward case. Python installs are independent and cleanly removable:

  1. Open Settings, then Apps, then Installed apps (or Apps and Features).
  2. Find the Python version you want to remove.
  3. Click it, choose Uninstall, and confirm.

Alternatively, run the same installer you used originally and it offers an Uninstall option.

After uninstalling, clean up two things the uninstaller may leave behind: stray PATH entries pointing at the removed version (edit environment variables), and the per-user package directory at %APPDATA%\Python if you want a truly clean slate. The py launcher is installed separately and stays unless you remove it too. Windows has no system Python that the OS depends on, so you can remove any version freely without worrying about breaking the operating system - the main risk is just leaving a dead PATH entry behind.

macOS: Homebrew or manual, never the system one

macOS ships its own Python that the OS uses. Do not remove it - Apple puts it in a protected location for exactly this reason. Remove only the ones you installed.

If you installed via Homebrew:

brew uninstall [email protected]       # remove a specific Homebrew Python
brew list | grep python          # see what Homebrew installed

If you used the python.org installer, remove it by hand - it lives in /Library/Frameworks/Python.framework and adds a folder in /Applications:

sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.12
sudo rm -rf "/Applications/Python 3.12"

Then clean the symlinks it created in /usr/local/bin that now dangle. The absolute rule: never rm anything under /usr/bin or the system framework. If which python3 points at /usr/bin/python3, that is the system copy - leave it. Remove your Homebrew or python.org versions and let the OS keep its own.

Linux: remove only what you added

This is where a careless uninstall does real damage. On most Linux distributions, the package manager and core system utilities are written in Python and depend on the exact version in /usr/bin. Removing it can break apt itself, leaving you unable to install anything - including a Python to fix it.

So never do this:

sudo apt remove python3          # DON'T - can break the whole system

Instead, remove only versions you added yourself. If you installed extra versions with pyenv, uninstall them through pyenv, which never touches the system copy:

pyenv versions                   # list what pyenv manages
pyenv uninstall 3.11.9           # remove one cleanly

If you installed a Python from a PPA or built one to /usr/local, remove that specific package or directory - not the distro’s python3. The guiding principle on Linux is absolute: the system Python is off limits, and everything you want to uninstall should be something you deliberately added on top of it.

Cleaning up what a Python leaves behind

Uninstalling the interpreter does not remove everything associated with it. A few leftovers are worth clearing for a genuinely clean removal:

  • Virtual environments created with that version - they still point at the now-gone interpreter and are just dead folders. Delete the .venv directories.
  • Globally installed packages in that version’s site-packages - removed with the interpreter, but a per-user pip directory may linger.
  • PATH entries and shell config - lines in .bashrc, .zshrc, or Windows environment variables that reference the removed version.
  • Editor and IDE settings pointing at the old interpreter path - update these or your tools will complain about a missing Python.

None of these break anything if left, but they cause the confusing why is it still finding the old version symptom. If, after uninstalling, python3 still resolves to something you thought you removed, a stale PATH entry or a shell config line is almost always why - check those before assuming the uninstall failed.

How this fits the rest of the stack

The care an uninstall demands - knowing which Python the system depends on versus which you added - is the same isolation problem a managed runtime solves by giving each service its own declared version. When the platform owns the interpreter a service runs against, removing or changing a local Python never touches what is deployed. The RunxBuild hosting calculator lays out the service, database, storage, and bandwidth as separate line items, and the RunxBuild dashboard is where the team watches deploys, logs, and restarts as they happen.

Useful related references:

FAQ

How do I uninstall Python?

It depends on the OS and how it was installed. On Windows, use Settings, Apps, and uninstall the version. On macOS, use brew uninstall [email protected] or remove a python.org install from /Library/Frameworks by hand. On Linux, remove only versions you added - never the system Python.

Can I uninstall the system Python on Linux?

No. Core OS tools and the package manager depend on the Python in /usr/bin, and removing it can break apt and leave the system unusable. Only uninstall Python versions you added yourself, such as ones managed by pyenv or installed to /usr/local.

How do I uninstall Python on a Mac?

For a Homebrew install, run brew uninstall [email protected]. For a python.org install, remove /Library/Frameworks/Python.framework/Versions/3.x and the matching folder in /Applications, then clean dangling symlinks in /usr/local/bin. Never remove the system Python in /usr/bin.

Why is the old Python still there after I uninstalled it?

Usually a stale PATH entry or a line in your shell config (.bashrc, .zshrc) still points at the removed version, so python3 resolves to a leftover. Check and clean those environment and shell settings - the interpreter files may be gone even though the path reference remains.

Does uninstalling Python remove my virtual environments?

No. Virtual environments are separate folders that reference the interpreter, so after you uninstall a Python version its venvs still exist but point at a missing interpreter and no longer work. Delete those .venv directories manually for a clean removal.

#uninstall python#python#macos#linux#dev-infra