How to uninstall Python on Windows, Mac and Linux

1. INTRODUCTION

• Python is a popular programming language used for various projects such as Creating GUIs, Web application, Machine learning, deep learning and also commonly used for Data science

• For python to be used in a computer, an IDE (Integrated development environment) is used. IDE is a tool that creates an environment that is much easier to debug, write and modify python code; common IDEs are: PyCharm, Jupyter Notebook, Spyder, and Microsoft visual studio.

Read Also: charAt in Python

• Generally, it is an easy step to install python for any OS; however, during execution, one may find various problems with the Python installation; such problems include; Python having trouble with the IDE, an outdated version may cause some program functionalities to fail, hence leading you to uninstall Python.

• How do we do that across different OS?

• Let’s have a look.

2. HOW TO UNINSTALL PYTHON ON WINDOWS


• Uninstalling Python from Windows is an easy step. To remove Python, follow the following steps.

STEP 1: CHECKING THE PYTHON VERSION


• You may wonder why you have to check your python version, yet you ultimately want to be done with it. Checking is a crucial step as it will be used to ensure that you are uninstalling the stated version and confirm that python has been deleted from your windows.
• The steps used are best for windows seven and above due to compatibility with python.
1. Press the Windows start button; a search bar will appear and type (cmd) to search for the command prompt, and press enter.
2. In the command prompt, type “python -v” and press enter; this will return the python version installed and confirm python is already on your computer.

STEP 2: UNINSTALLING USING CONTROL PANEL MANUALLY


• For this step, you will need to close the command prompt.
• Click the Windows key start button, and on the search bar, type “control panel”.
• Click enter to access the control panel, where you will find options for adjusting computer settings.
• On the bottom left corner of the control panel, you will find the “programs” option, and beneath it is the “uninstall a program” option; click the uninstall a program option.
• Two options will pop up, i.e., “programs and features” and “default programs”.
• Beneath “programs and features,” click “uninstall a program”.
• Various programs installed on your computer will appear. You can choose to scroll down to where the stated python version appears on the list, or you can use the search bar and search “python.”
• Two programs will appear i.e the python version and the launcher. Double click on the python version to uninstall, where a pop-up will appear, prompting you to confirm that you want to uninstall. Click yes and wait for it to complete
• Repeat the process for the python launcher

FINAL STEP: CHECK USING COMMAND PROMPT IS PYTHON STILL EXISTS


• Remember how we checked the python version of the previously installed python.
• Those steps will come in handy to confirm that python has completely being removed.
• Follow the previous steps and go to the command prompt, and type “python -v”.
• If the cmd can no longer recognize python, then python has been successfully uninstalled.

3. HOW TO UNINSTALL PYTHON ON MAC OS


• Uninstalling python on mac is not that different from windows; however, macs’ python is usually already installed before shipping; hence uninstalling a pre-installed version is unnecessary. It will cause problems with your OS.
The following are the best alternative steps for
• uninstalling python on mac

STEP 1: CHECKING THE PRE-INSTALLED PYTHON VERSION USING TERMINAL


• Just like windows, it is essential to check the python version installed
• At the top right corner of your Mac OS, click the spotlight search button and type “Terminal,” and double click
• In the terminal, type “python3 - - version” and click enter to check the python version installed
• After the output of the python version has been returned, type “which python3” to return the python location and only copy the following
“/Library/Frameworks/Python.Frameworks/Versions“

STEP 2: REMOVING PYTHON FROM FOLDER AND PATH


• The next step is to use “Finder,” which is at the bottom left of the screen. Once you click it, use the (command+shift+G) keys at the same time to pop up, paste the path of the file from the previous step, and press go.
• This will give us the python location with the stated version. Right-click on it and confirm to delete python before being moved to trash mac will require your password for security reasons; insert it, and the deletion will be complete.
• For this next step, you may want to remove the python application itself. Go to the applications bar and scroll until you find python to delete. Right-click on the app and insert the password again to complete the deletion.

FINAL STEP: CONFIRMING PYTHON DELETION


• To confirm that python has been wholly removed, use the terminal and type ”python3 –version”.
• If the output is macOS has failed to locate python, then the uninstallation was successful.

4. HOW TO UNINSTALL PYTHON ON LINUX


• Uninstalling python from Linux is also an easy step, although this is more command-line based
• Let’s see the steps

STEP1:USING TERMINAL TO CHECK PIP VERSION OF PYTHON


• For Linux, its easy shortcuts for navigation will speed up the uninstallation process
• To access the Linux terminal, use the “CTRL+ALT+T” shortcut, and the terminal will appear
• To determine the package installed, use “python3 - -version” the output will be the python version installed

FINAL STEP: UNINSTALLING PYTHON USING TERMINAL


• To remove python, you will have to use the code “sudo apt-get autoremove python-pip” and press enter
• After computing for a short while, you will be prompted to continue with the uninstallation press “Y” to complete the removal

5. CONCLUSION

1. It is essential to check and recheck the python version before and after installation to confirm python was already installed, type of version, and python has been successfully uninstalled
2. For macOS, it is advised not to uninstall the python version since it may cause problems for the OS
3. The shortcut keys for Linux makes it easier and faster to delete python

About The Author

Subham Mittal has worked in Oracle for 3 years.
Enjoyed this post? Never miss out on future posts by subscribing JavaHungry