Skip to content

RESOURCES / BLOG

How Do I Uninstall Python (Without Breaking Everything)?

Hi all,

I’ve got multiple versions of Python installed on my machine, and I want to clean things up. Some scripts are getting confused, pip isn’t working as expected, and it’s just a mess. 

How do I uninstall Python properly without breaking important system functions (especially on macOS and Linux)? I’m using Python for small web scripts and some Cloudinary image automation, so I don’t want to wreck those either.

Can someone explain how to remove old versions, and when it’s actually safe to do so?

Thanks in advance!

Great question, and you’re definitely not alone. Many developers end up with Python clutter: old installs, broken paths, overlapping virtual environments, and the dreaded “which Python is which?” issue.

Uninstalling Python can be easy on Windows… but trickier on macOS and Linux, where Python might be tied to system processes.

Let’s walk through the safest ways to uninstall Python across platforms and how to avoid breaking essential workflows, especially if you use tools like Cloudinary in Python scripts.

Open a command prompt and run py -0. This lists all installed Python versions (e.g., 3.8, 3.11, 3.12).

  1. Open the Start menu.
  2. Search for Add or Remove Programs.
  3. Look for Python 3.X (multiple entries if you installed multiple versions).
  4. Click Uninstall.

Repeat this for every version you want to remove.

After uninstalling, you might want to manually delete these folders:

  • C:\Users\<YourUser>\AppData\Local\Programs\Python
  • C:\Users\<YourUser>\AppData\Roaming\Python

Also, check for any PATH references:

  1. Right-click This PC > Properties > Advanced system settings.
  2. Click Environment Variables
  3. Under System variables, remove any Python-related entries in PATH.
Tip

Don’t uninstall the version used by critical applications unless you’re sure it’s safe.

Tip: Don’t uninstall the version used by critical applications unless you’re sure it’s safe.

macOS comes with a system version of Python (usually 2.7 or a minimal 3.x). Never uninstall the system Python; macOS uses it for core operations.

Instead, remove versions you installed manually via Homebrew, the official installer, or Pyenv.

Try using brew uninstall python.

If you want to check what’s installed via Homebrew, try brew list.

You might also run brew cleanup to remove old, unused versions.

If you used the .pkg installer from python.org, try:

sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.X

sudo rm -rf "/Applications/Python 3.X"Code language: JavaScript (javascript)

Then clean up symbolic links with:

sudo rm /usr/local/bin/python3

sudo rm /usr/local/bin/pip3

Check your shell config files (.bashrc, .zshrc, etc.) for any Python PATH changes.

Like macOS, many Linux systems (especially Ubuntu) rely on Python (often Python 3) for system operations. Don’t remove the system version unless you’re 100% sure.

Using which python3 will show you where Python has been installed.

python3 --version shows you what versions are currently installed on your machine.

If you installed Python via apt:

sudo apt remove python3.12

sudo apt autoremoveCode language: CSS (css)

Look up the documentation for whatever package manager your Linux distribution uses, whether it’s dnf, pacman, yum or others, to know the right commands to uninstall a package.

If you installed via source (manually compiled):

sudo rm -rf /usr/local/bin/python3.12

sudo rm -rf /usr/local/lib/python3.12

If you used Pyenv:

pyenv uninstall 3.12.0

And to list installed versions via Pyenv:

pyenv versions

Python environments created with venv or virtualenv are self-contained, so uninstalling Python won’t always remove them, but those environments might stop working.

If you’re switching to a new version of Python, recreate your virtual environment:

python3.12 -m venv newenv

source newenv/bin/activate

pip install -r requirements.txt

This is especially important if you’re using the Cloudinary Python SDK in your image workflows.

  • Delete .pyenv/, ~/.local/, and __pycache__ directories if you’re not using them.
  • Clear pip cache with pip cache purge.
  • Remove old symbolic links or aliases (alias python=...) in your shell config files.

If your scripts use Python to upload or manage images through Cloudinary, you’ll want to:

  1. Reinstall Cloudinary with pip install cloudinary.
  2. Reconfigure API credentials in your script:
import cloudinary

cloudinary.config(

  cloud_name = "your-cloud",

  api_key = "your-api-key",

  api_secret = "your-secret"

)Code language: JavaScript (javascript)
  1. Test uploads:
import cloudinary.uploader

result = cloudinary.uploader.upload("image.jpg")

print(result["secure_url"])Code language: JavaScript (javascript)

If your uninstall process breaks your Cloudinary integration, simply create a new environment and reinstall your packages.

OSSafe Method
WindowsUse “Add or Remove Programs”, clean up leftovers manually
macOSOnly uninstall versions installed manually (Homebrew or .pkg)
LinuxAvoid removing system Python; only uninstall additional versions

Knowing how to uninstall Python safely is a key part of keeping your development environment clean and functional. Especially if you work with automated scripts, removing the wrong Python version can cause massive problems for your workflows.

The good news: modern tools like pyenv and uv, virtual environments, and version managers make switching between Python installs far safer than it used to be.

Still feeling unsure about which version to remove, or how to update your image workflows after uninstalling Python? Drop us a question. We’re happy to help you sort it out.

Start Using Cloudinary

Sign up for our free plan and start creating stunning visual experiences in minutes.

Sign Up for Free