How to Uninstall Python

What you’ll build or solve

You’ll uninstall Python from your computer and confirm the old version no longer runs in your terminal.

When this approach works best

This approach works best when you:

  • Installed the wrong Python (or several) and want a clean reset before reinstalling.
  • Need to uninstall a bundled Python that conflicts with your preferred setup.
  • Are troubleshooting PATH issues where your terminal keeps using an older Python.

Avoid this approach when:

  • Your job or school manages your device and requires IT approval.
  • Your system tools depend on the OS Python, common on Linux and sometimes macOS. Uninstalling it can break package managers or system scripts.

Prerequisites

  • Access to your OS app uninstall tools (Windows Settings, macOS Applications, Linux package manager)
  • A terminal to verify what runs after uninstalling

Step-by-step instructions

1) Identify which Python you’re uninstalling

Many machines have more than one Python. Before uninstalling anything, check the version and executable path.

python --version
python -c "import sys; print(sys.executable)"

If python is not available, try:

python3 --version
python3 -c "import sys; print(sys.executable)"

What to look for: the sys.executable path tells you which installation you’re targeting, such as python.org installer, Microsoft Store, Anaconda, Homebrew, pyenv, or system Python.


2) Uninstall on Windows

Option A (most common): Uninstall from Settings

If you installed with the Python install manager, do this instead of steps 1–3. To remove one version, run pymanager uninstall 3.15 and keep the manager for the others. To remove everything, run pymanager uninstall --purge, then uninstall Python install manager from Installed apps. Uninstalling the manager alone leaves its runtimes in place, and if no runtimes remain but the manager stays, running python can install the latest version again.

  1. Open Settings → Apps → Installed apps (or Apps & features).
  2. Search for Python.
  3. Uninstall the Python entries you want to remove, for example “Python 3.12.x”.

Verify in a new terminal:

python --version
where.exe python
py -V

What to look for: where.exe python lists every python.exe in the current folder and on your PATH. The first path is usually what runs when you type python.

Option B (alternative): Uninstall with winget

If you installed Python with winget, use the exact ID that winget list python shows, for example Python.Python.3.12:

winget list python
winget uninstall --id Python.Python.3.12 -e

Then check:

python --version
where.exe python

Clean up PATH if needed

If where.exe python still shows old paths after uninstalling:

  • Remove stale Python paths from Environment Variables (search “Edit the system environment variables” → Environment Variables → edit Path).
  • Check Microsoft Store aliases: Settings → Apps → Advanced app settings → App execution aliases. Turn off aliases that open the Microsoft Store; if you keep the Python install manager, turn on its Python (default) aliases instead.

Verify again:

where.exe python
python --version

If python still runs but points somewhere unexpected, a leftover PATH entry or execution alias is usually the cause.


3) Uninstall on macOS

macOS setups vary. The safest approach depends on how Python was installed.

Option A (most common): Uninstall a Homebrew Python

If which python3 points to Homebrew:

which python3
brew list --versions python
brew uninstall python

Verify:

python3 --version
which python3

Option B (alternative): Uninstall a python.org installer Python

If you installed from python.org, you may have a framework install under /Library/Frameworks.

Check if it exists:

ls /Library/Frameworks/Python.framework

⚠️ These commands permanently delete files and remove every python.org Python version on your Mac, not just one. Only proceed if you are sure you installed Python from python.org and want it removed.

List the links the installer added to /usr/local/bin:

find /usr/local/bin -lname '*/Library/Frameworks/Python*.framework/*'

Review the list, then delete those links, the framework, and the app folders:

sudo find /usr/local/bin -lname '*/Library/Frameworks/Python*.framework/*' -delete
sudo rm -rf /Library/Frameworks/Python.framework /Library/Frameworks/PythonT.framework
sudo rm -rf "/Applications/Python 3."*

The installer may also have added a /Library/Frameworks/Python.framework PATH line to your shell profile, such as ~/.zprofile. Delete that line, then open a new terminal.

Verify:

python3 --version
which python3
python3 -c "import sys; print(sys.executable)"

If which python3 points to /usr/bin/python3, that is usually the system Python. Treat it as part of macOS.


4) Uninstall on Linux

On Linux, python3 is often a system dependency. Uninstalling the system Python can break your package manager and desktop.

Option A (recommended): Uninstall non-system Python only

If you used pyenv:

pyenv versions
pyenv uninstall 3.12.8
python --version

If you installed Python from source into /usr/local or a custom folder, remove that install instead of touching distro python3.

If which python3 points to /usr/bin/python3, that is almost always the system Python. Leave it installed.

Option B: Keep package-installed Python installed

Removing distro python3 can break your system. A safer fix is to install another version via pyenv and set it as default.


5) Remove leftover project environments

Uninstalling Python does not delete your project folders, but virtual environments created with the removed Python can stop working.

Delete the venv folder in projects where you plan to reinstall.

macOS/Linux:

rm -rf .venv

Windows PowerShell:

Remove-Item -Recurse -Force .venv

Common venv folder names include .venv and venv.


6) Verify the uninstall worked

Run these checks:

python --version
python3 --version

If Python still exists, confirm which executable you’re running:

python -c "import sys; print(sys.executable)"
python3 -c "import sys; print(sys.executable)"

If you expected Python to be fully uninstalled, but it still runs, you still have another installation on your machine, such as Homebrew, Anaconda, pyenv, or a leftover PATH entry.


Examples you can copy

Example 1: Windows uninstall and confirm

python --version
where.exe python
winget list python
winget uninstall --id Python.Python.3.12 -e
where.exe python
python --version

Use this when you installed with winget. Replace Python.Python.3.12 with the ID from winget list python, then confirm that version no longer shows up.

Example 2: macOS uninstall Homebrew Python

which python3
brew uninstall python
which python3
python3 --version

Use this when which python3 points to a Homebrew path.

Example 3: pyenv uninstall one version

pyenv versions
pyenv uninstall 3.12.8
pyenv versions
python --version

Use this when you want to remove only one version without touching the system Python.


Common mistakes and how to fix them

Mistake 1: Uninstalling Python, but python still runs

You uninstall Python from your OS apps list, but python --version still prints a version.

Why it happens: another Python installation is still present, or PATH/execution aliases still point elsewhere.

Fix: locate the executable, then uninstall that installation method.

Windows:

where.exe python
py -V

macOS/Linux:

which python
which python3
python -c "import sys; print(sys.executable)"
python3 -c "import sys; print(sys.executable)"

Then uninstall the matching method, such as Homebrew, pyenv, Anaconda, or the python.org installer.

Mistake 2: Uninstalling system Python on Linux

You run apt remove python3 to uninstall Python completely.

Why it breaks: many system components depend on python3, so uninstalling it can remove critical packages.

Fix: keep system python3 and use pyenv for your project Python instead.


Troubleshooting

  • If python still resolves after uninstalling on Windows, run where.exe python, remove stale PATH entries, and turn off execution aliases that open the Microsoft Store (if you keep the Python install manager, turn on its Python (default) aliases).
  • If you see zsh: command not found: python3 on macOS but still want Python, reinstall with Homebrew or python.org.
  • If your Linux uninstall wants to remove many packages, cancel it and uninstall only non-system versions.
  • If you see Permission denied when deleting files, use admin privileges (sudo on macOS/Linux or run PowerShell as Administrator on Windows).
  • If your project breaks after uninstalling, delete and recreate the virtual environment with the Python you keep.

Quick recap

  • Check the version and executable path first.
  • Uninstall using the method that matches how Python was installed.
  • On Windows, clean up PATH or execution aliases if python still points to an old location.
  • On Linux, keep system python3, uninstall only non-system versions.
  • Delete old virtual environments created with the removed Python.
  • Verify what python and python3 resolve to after uninstalling.