How to completely remove Python from a Windows machine?

Question:

I installed both Python 2.7 and Python 2.6.5. I don’t know what went wrong, but nothing related to Python seems to work any more. e.g. “setup.py install” for certain packages don’t recognize the “install” parameter and other odd phenomena…

I would like to completely remove Python from my system.
I tried running the 2.7 and 2.6 msi files and choosing remove Python and then running only 2.6 and reinstalling it. Still stuff don’t work.

How do I completely remove Python – from everything? (!)

I would not like to reinstall my entire machine just because of the Python install…

Asked By: Jonathan Livni

||

Answers:

Almost all of the python files should live in their respective folders (C:Python26 and C:Python27). Some installers (ActiveState) will also associate .py* files and add the python path to %PATH% with an install if you tick the “use this as the default installation” box.

Answered By: Nick T

You will also have to look in your system path. Python puts itself there and does not remove itself: http://www.computerhope.com/issues/ch000549.htm

Your problems probably started because your python path is pointing to the wrong one.

Answered By: Alex Bliskovsky

Run ASSOC and FTYPE to see what your py files are associated to. (These commands are internal to cmd.exe so if you use a different command processor ymmv.)

C:> assoc .py
.py=Python.File

C:> ftype Python.File
Python.File="C:Python26.w64python.exe" "%1" %*

C:> assoc .pyw
.pyw=Python.NoConFile

C:> ftype Python.NoConFile
Python.NoConFile="C:Python26.w64pythonw.exe" "%1" %*

(I have both 32- and 64-bit installs of Python, hence my local directory name.)

Answered By: dash-tom-bang

Here’s the steps (my non-computer-savvy girlfriend had to figure this one out for me, but unlike all the far more complicated processes one can find online, this one works)

  1. Open Control Panel
  2. Click “Uninstall a Program”
  3. Scroll down to Python and click uninstall for each version you don’t want anymore.

This works on Windows 7 out of the box, no additional programs or scripts required.

Answered By: ArtOfWarfare

Windows 7 64-bit, with both Python3.4 and Python2.7 installed at some point 🙂

I’m using Py.exe to route to Py2 or Py3 depending on the script’s needs – but I previously improperly uninstalled Python27 before.

Py27 was removed manually from C:pythonPython27 (the folder Python27 was deleted by me previously)

Upon re-installing Python27, it gave the above error you specify.
It would always back out while trying to ‘remove shortcuts’ during the installation process.

I placed a copy of Python27 back in that original folder, at C:PythonPython27, and re-ran the same failing Python27 installer. It was happy locating those items and removing them, and proceeded with the install.

This is not the answer that addresses registry key issues (others mention that) but it is somewhat of a workaround if you know of previous installations that were improperly removed.

You could have some insight to this by opening “regedit” and searching for “Python27” – a registry key appeared in my command-shell Cache pointing at c:pythonpython27 (which had been removed and was not present when searching in the registry upon finding it).

That may help point to previously improperly removed installations.

Good luck!

Answered By: Jordan Stefanelli

I know it is an old question, but I ran into this problem with 2.7 and 3.5. Though 2.7 would not show up in my default windows uninstall list, it showed up fine in the ccleaner tools tab under uninstall. Uninstalled and reinstalled afterwards and it has been smooth coding ever since.

Answered By: Ventian

I had window 7 (64 bit) and Python 2.7.12,
I uninstalled it by clicking the python installer from the “download” directory then I selected remove python then I clicked “ finish”.
I also removed the remaining python associated directory & files from the c: drive and also from “my documents” folder, since I created some files there.

Answered By: Thelma

Uninstall the python program using the windows GUI.
Delete the containing folder e.g if it was stored in C:python36 make sure to delete that folder

Answered By: Patrick Mutuku

It’s actually quite simple.
When you installed it, you must have done it using some .exe file (I am assuming). Just run that .exe again, and then there will be options to modify Python. Just select the “Complete Uninstall” option, and the EXE will completely wipe out python for you.

Also, you might have to checkbox the “Remove Python from PATH”. By default it is selected, but you may as well check it to be sure 🙂

Answered By: Anirudh Prabhakaran

you can delete it manually.

  1. open Command Prompt
  2. cd C:Users<you name>AppDataLocalMicrosoftWindowsApps
  3. del python.exe
  4. del python3.exe

Now the command prompt won’t be showing it anymore

where python –> yields nothing, and you are free to install another version from source / anaconda and (after adding its address to Environment Variables -> Path) you will find that very python you just installed

Answered By: angelo.mastro

Windows Start Menu > Settings > Apps > Apps & features > Select the app and click the Uninstall button

Answered By: MacGyver
  1. Open CMD

  2. To show all packages installed – pip list

  3. To copy the packages name to a file – pip freeze > requirements.txt

  4. To delete all packages – pip uninstall -r requirements.txt -y

  5. Check all packages are removed – pip list

  6. Uninstall pip and other remaining packages

  7. Control panel > Uninstall > Python uninstall (from UI)

Answered By: Nikhil Jain

If you still have the python installer on your PC, you can double-click on it (run it, it will open the installer window), and select the "Uninstall" option. It will uninstall that python version (if the installer is for Python3.9, then Python3.9 will be uninstalled, if it is for Python3.10, then that version…)

Answered By: Hrushikar Teja K

First, uninstall Python, then remove the pip packages you installed.

  • Uninstall Python: "Add or Remove Programs", search for Python and uninstall it.
  • Remove Pip packages: type in File Explorer %LOCALAPPDATA%ProgramsPython, and remove the folders you want.

This will clean up any pip package you installed. Otherwise, if you were to reinstall Python, you will find yourself with the same pip packages that you had.

Answered By: Sarye Haddadi

install IObit uninstaller it will completely remove Python.

Answered By: Hrishikesh roy