How to Uninstall Python from Windows, Mac or Linux

by | Python

Python may come pre-installed, or you may have multiple versions co-existing on your system.

But sometimes, you just need to uninstall it.

Maybe you want to free up space, resolve conflicting versions, or start fresh with a new installation; either way, let’s uninstall Python, aka remove the snake.

To uninstall Python on Windows, go to the Control Panel, select “Programs and Features,” find Python in the list of installed programs, right-click on it, and choose “Uninstall.” If you are using macOS, you can uninstall Python by removing the relevant directory or using Homebrew if applicable. In Linux, you can use the package manager or manually delete the directory where Python is installed.

In this article, we will guide you through the exact process of uninstalling Python on various operating systems, including Windows, macOS, and Linux.

By following these steps, you can successfully remove Python from your operating system.

Let’s start with Windows, but please scroll down for Mac & Linux.

4 Methods to Uninstall Python on Windows

How to Uninstall Python

If your operating system is Windows, you can use the following 4 methods for uninstalling Python:

  1. Using Windows Settings

  2. Using the Control Panel

  3. Using the Command Line

  4. Using Python’s Own Uninstaller

4 Methods to Uninstall Python on Windows

Method 1: How to Uninstall Python Using Windows Settings

Follow the steps given below to uninstall Python using Windows Settings on a Windows system:

Step 1

Open the “Settings” app from the Start menu or by pressing Win + I.

Opening settings

Step 2

Navigate to “Apps” and then to “Apps & features”.

Opening Apps and Features

Step 3

Scroll through the list or use the search bar to find Python.

Searching Python in Apps

Step 4

Click on Python, and then select “Uninstall”.

Clicking the uninstall option

After clicking uninstall, follow the on-screen prompts to complete the uninstallation process.

Method 2: How to Uninstall Python Using The Control Panel

To uninstall Python from Windows using the control panel, follow the steps given below:

Step 1

Open the Control Panel. You can do this by searching for “Control Panel” in the Start menu.

Opening Control Panel

Step 2

Click on “Programs and Features”. If your Control Panel is in category view, you’ll first click on “Programs”.

Navigating to Programs and Features

Step 3

In the list of installed programs, find Python.

Finding Python in Installed Programs

Step 4

Right-click on Python and choose “Uninstall”.

Finding Python in Installed Programs

This will uninstall Python from your Windows operating system.

Method 3: How to Uninstall Python Using The Command Line

You can also uninstall Python using the command line in Windows. You can follow the steps given below:

Step 1

Open the Command Prompt as an administrator. You can do this by searching for “cmd” in the Start menu, right-clicking on Command Prompt, and selecting “Run as administrator”.

Opening CMD

Step 2

In the Command Prompt, type the following command to list all installed programs:

wmic product get name

The list of programs looks like the following:

List of installed programs

Step 3

To uninstall Python, use the following command, replacing “Python x.x.x” with the exact name of the Python version you identified.

wmic product where name="Python x.x.x" call uninstall

After running the command, Python will be uninstalled from your operating system.

Method 4: How to Uninstall Python Using Python’s Own Uninstaller

Python comes with its own uninstaller that allows you to uninstall Python.

To do this, follow the steps given below:

Step 1

Navigate to the Python installation directory on your computer. This is typically located in a path like C:Users[Your Username]AppDataLocalProgramsPythonPythonXX or C:PythonXX, where XX is the version number of Python.

Locating Python directory

Step 2

In the Python installation folder, look for an executable named uninstall.exe or something similar.

Double-click on this executable to start the uninstallation process.

Locating the uninstaller

Next, the uninstaller will guide you through the process. After done, Python will be uninstalled from your operating system.

3 Methods to Uninstall Python on Mac

In this section, we will go over 3 methods to uninstall Python on Mac.

Specifically, we will go over the following:

  1. Using the Terminal

  2. Using Finder

  3. By Removing Python from PATH

Method 1: How to Uninstall Python on Mac Using The Terminal

Follow the steps given below to uninstall Python on Mac using the terminal:

Step 1

Open the Terminal application. First, determine which Python version you want to uninstall. System Python (typically Python 2.7 on older Macs) should not be removed as it could affect system stability.

You can check the installed Python versions by typing python –version or python3 –version in the Terminal.

Step 2

If the Python version was installed with Homebrew, uninstall it by typing:

brew uninstall python

This will uninstall Python from your macOS.

Method 2: How to Uninstall Python on Mac Using Finder

You can follow the steps given below to uninstall Python on Mac using Finder:

Step 1

If Python was installed from a package, you can delete the Python applications from the Applications folder.

Navigate to /Applications and find the Python folder or Python app.

Step 2

Move it to the Trash and empty the Trash to complete the uninstallation.

Method 3: How to Uninstall Python on Mac By Removing Python From PATH

Follow the steps given below to uninstall Python by removing Python From PATH:

Step 1

Open Terminal. Edit .bash_profile, .zshrc, or .bashrc, depending on your shell and configuration, using a text editor like nano or vim (nano ~/.bash_profile).

Step 2

Remove any lines that add Python files and directories to the PATH variable.

Step 3

Save the file and restart the Terminal.

This will remove Python from the PATH.

3 Methods to Uninstall Python on Linux

In this section, we will go over 3 methods to uninstall Python on Linux.

Specifically, we will go over the following:

  1. Using Package Managers

  2. Uninstalling Python Installed from Source

  3. Manual Uninstallation

3 Methods to Uninstall Python on Linux

Methods 1: How to Uninstall Python Using Package Managers

To uninstall Python using package managers on Linux depends on the distribution and the package manager used.

Below, we have listed the methods for the most common package managers:

1) APT (For Debian-based Distributions Like Ubuntu)

To uninstall Python, first open the Terminal.

You can use the following command to uninstall Python:

sudo apt-get remove python3.x

Replace 3.x with the specific version number you want to uninstall.

2) YUM (For Older Red Hat-based Distributions)

Open the Terminal.

Use the following command to uninstall Python:

sudo yum remove python3.x

Replace 3.x with the version number.

3) DNF (For Fedora And Newer Red Hat-based Distributions)

Open the Terminal.

You can the following command to uninstall Python:

sudo dnf remove python3.x

Method 2: How to Uninstall Python Installed From Source

To uninstall Python from source on Linux requires a more manual approach, as there is typically no automated uninstall command provided.

You can follow the following steps to uninstall Python using this method:

Step 1: Revisit The Source Directory

Go back to the folder named Python where you originally compiled and installed Python.

This is the directory where you ran the ./configure, make, and make install commands.

Step 2: Use Make Install to Identify Installed Files

Run “make install” again.

This won’t reinstall Python but will show you where the files were installed. Look for lines that indicate where files are copied (like /usr/local/bin/python3.x).

Step 3: Manually Remove The Files And Directories

Based on the output of make install, manually delete the additional Python files from their install locations.

Common directories to check include /usr/local/bin for executable files and /usr/local/lib/python3.x for libraries and site-packages.

Step 4: Remove Symbolic Links

If you created any symbolic links (like python3 pointing to this version), remove those links.

For example, sudo rm /usr/local/bin/python3.

After the above steps, Python will be uninstalled from your Linux operating system.

Uninstalling Python Installed From Source

Learn Advanced Data Analytics (ADA) by watching the following video:

Final Thoughts

As you step back from the details of uninstalling Python, it’s important to recognize why understanding this process adds value to your technical skill set. Whether you’re a developer, a system administrator, or simply an enthusiast dabbling in coding, knowing how to properly remove software is as crucial as installing it. By mastering this, you ensure that your system remains clean, efficient, and free from unwanted or outdated components.

Sometimes an installation doesn’t go as planned, or an upgrade is necessary due to a pre installed version of Python. In such cases, uninstalling Python might be the first step in troubleshooting or making room for a fresh, updated version. This knowledge empowers you to maintain control over your environment, reduce potential conflicts between software versions, and keep your workspace organized and functional.

Frequently Asked Questions

In this section, you will find some frequently asked questions you may have when uninstalling Python from your operating system.

Programmers writing code in office

How can I remove Python from my Mac using Terminal?

First, to remove Python from your Mac using the Terminal, determine the version you want to remove by typing which -a python or which -a python3. It will give you the library folder and multiple Python versions.

Next, use the rm command to delete the Python binary, for example, sudo rm /usr/local/bin/python3.

This will delete Python from root user directory.

Finally, double-check if any related files or folders remain and delete them if necessary.

Is it possible to uninstall Python using Homebrew?

If you installed Python using Python packages, such as Homebrew, you can uninstall it by running the command brew uninstall python.

This will remove the specific Python version installed by Homebrew, without affecting any pre-installed system versions.

What is the process to uninstall Python 3.10 on a Mac?

To uninstall Python 3.10 on a Mac, first, locate the installation folder and binary by running which python3.10.

Then, use the rm command to remove the binary and delete the installation folder.

For example: sudo rm /usr/local/bin/python3.10 and sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.10.

How can I unistall Python 3 from my computer?

To uninstall Python 3 from your computer, first determine your operating system and follow the appropriate steps.

Go to Control Panel > Uninstall a Program on Windows, select Python 3, and follow the uninstallation prompts.

Use Terminal to locate the Python 3 binary and installation folder on macOS, then remove them using the rm command.

What are the steps to remove Python 3.11 from a Mac?

To remove Python 3.11 from a Mac, locate the installation folder and binary by running which python3.11.

Then, use the rm command to remove the binary and delete the installation folder.

For example: sudo rm /usr/local/bin/python3.11 and sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.11.

How to Uninstall Python Using Third Party Python Framework in Windows

To uninstall an already pre installed Python version on Windows using a third-party tool like Revo Uninstaller or CCleaner, first download and install the chosen tool from its official website.

Then, run the tool, locate Python in the list of installed programs, and select the option to uninstall.

These tools often provide thorough removal by also cleaning up leftover files and registry entries.

author avatar
Sam McKay, CFA
Sam is Enterprise DNA's CEO & Founder. He helps individuals and organizations develop data driven cultures and create enterprise value by delivering business intelligence training and education.

Related Posts