Search code examples
pythonweb-platform-installer

How do I uninstall python from web platform installer?


I've installed python and some other packages using web platform installer, but I was having some issues getting a Django project to work so I uninstalled everything and am trying to get it going from scratch. Web Platform Installer still shows that I have 'Windows Azure SDK for Python" and "Python 2.7 (32-bit)" installed however and I can't mark them as uninstalled.

I don't see where to uninstall from WPI at all, I uninstalled them using control panel. I think I had originally installed python from the python site and had version 3.3 and 2.7 (64-bit), but now there are no entries containing 'python' when I try to uninstall a program from the control panel.

Does anyone know what is going on or can I download the setups from somewhere and try them manually? Is there a way to reset what shows as installed in WPI? I tried uninstalling and reinstalling WPI but that didn't help.

enter image description here


Solution

  • I found a PowerShell script in the WPI directory that checked for python installs and I had to delete the registry keys specified in it.


    Let me add some context:

    Open the below path,

    %LOCALAPPDATA%\Microsoft\Web Platform Installer\installers\PythonDetectInstalls
    

    in the sub-folder of the above path, there is a PowerShell script "DetectPythonInstalls.ps1" which contains two script lines for checking if Python is installed:

    $regKey = "hklm:SOFTWARE\Python\PythonCore\$pythonVersion\InstallPath";
    $correctRegKey = "hklm:SOFTWARE\Wow6432Node\Python\PythonCore\$pythonVersion\InstallPath";
    

    Uninstall all Python versions you do not neet. However, we need to remove some registry keys manually using "regedit".

    (Safety Note: Please take a backup of the registry keys before removing the above-mentioned registry key)

    Ref: Social.Tecnet