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:
Learn Python on Mimo
- 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
- Open Settings → Apps → Installed apps (or Apps & features).
- Search for Python.
- Uninstall the Python entries you want to remove, for example “Python 3.12.x”.
Verify in a new terminal:
SQL
python--version
where python
py-V
What to look for: where python shows every python.exe Windows can find. The first path is what runs when you type python.
Option B (alternative): Uninstall with winget
If you installed Python with Winget:
winget list python
winget uninstall Python.Python.3
Then check:
SQL
python--version
where python
Clean up PATH if needed
If where 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, and turn off
python.exe/python3.exeif they hijack your command.
Verify again:
SQL
where 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:
Bash
which python3
brew list--versions python
brew uninstall python
Verify:
Bash
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:
Bash
ls /Library/Frameworks/Python.framework
⚠️ These commands permanently delete files. Only proceed if you are sure you installed Python from python.org and want it completely removed.
Swift
sudorm-rf /Library/Frameworks/Python.framework
sudorm-f /usr/local/bin/python3
sudorm-f /usr/local/bin/pip3
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:
CSS
pyenv versions
pyenv uninstall3.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 (not recommended): Uninstall package-installed Python
Removing distro python3 can break your system. A safer fix is to install another version via pyenv and set it as default.
Ubuntu/Debian example:
sudo apt remove python3
Stop if the uninstall wants to remove many system packages. That is a sign you are removing a core dependency.
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:
CSS
python--version
python3--version
If Python still exists, confirm which executable you’re running:
python-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
SQL
python--version
where python
winget uninstall Python.Python.3
where python
python--version
Use this when you installed with Winget and want to confirm the command no longer resolves.
Example 2: macOS uninstall Homebrew Python
Bash
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
CSS
pyenv versions
pyenv uninstall3.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:
Bash
where python
py-V
macOS/Linux:
Bash
which python
which python3
python-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
pythonstill resolves after uninstalling on Windows, runwhere python, remove stale PATH entries, and disable Microsoft Store execution aliases. - If you see
zsh: command not found: python3on 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 deniedwhen deleting files, use admin privileges (sudoon 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
pythonstill 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
pythonandpython3resolve to after uninstalling.
Join 35M+ people learning for free on Mimo
4.8 out of 5 across 1M+ reviews
Check us out on Apple AppStore, Google Play Store, and Trustpilot