Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to silently uninstall Python 2.7 on Windows?

Does anyone know how to silently uninstall Python 2.7 - i.e. uninstall it unattended, with no need for user interaction? I need to do it as part of an uninstallation script that installs a bunch of software silently.

I've tried running msiexec with the /x and /qn flags on the msi file that was originally installed, but it fails - it just throws up the general help message, implying that I'm using invalid options.

I've done a Google search, and can find help for earlier versions - they can be uninstalled silently by running the unwise.exe that's installed with them, with the right options. But 2.7 doesn't seem to include an unwise.exe, so I can't do that.

Does anyone know how to do this?

Edit: The answer turned out to be embarrassingly simple. Those were the correct command-line options all along - it's just that the order matters. The correct command was:

msiexec /x python-2.7.3.amd64.msi /qn

The important thing was to have the /qn option after the msi file.

like image 577
Mike Collins Avatar asked Mar 13 '13 20:03

Mike Collins


People also ask

How do I uninstall Python 2.7 from command prompt?

Follow this steps to completely Uninstall Python From Windows. First of all open your Command Prompt. Then run this cd C:\Users\<you name>\AppData\Local\Microsoft\WindowsApps Then del python.exe Then del python3.exe After of this steps you will find completely uninstalled python.


1 Answers

Edit: Ignore what I previously said, here's the solution according to the Python 2.4 Documentation:

It is not necessary to have the MSI file available for uninstallation; alternatively, the package or product code can also be specified. You can find the product code by looking at the properties of the Uninstall shortcut that Python installs in the start menu.

Hit the Windows Key, search Python Uninstall, right click it and go to Properties. The Product Key is in the Target field, you can use that to uninstall by doing:

msiexec /x {03mY-L0NG-A77-K3Y}.msi /qn
like image 107
Murkantilism Avatar answered Oct 06 '22 01:10

Murkantilism