Need a programmatic method to uninstall python on Windows Server 2022.

Anonymous
2023-12-08T08:10:20+00:00

Python tool uninstallation fails when tried using commandline method. [Uninstall-Package" or "& cmd /c $UninstallString /quiet /uninstall" ] Both the methods fail. Please suggest some alternate route to resolve this.

Windows for business | Windows Server | User experience | PowerShell

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Anonymous
    2023-12-11T07:22:33+00:00

    Hi,

    What is the UninstallString? Have you checked the msi.log file for details?

    See if you can uninstall the MSI using msiexec.exe

    MsiExec.exe /x /quiet <MSI-File-Path>

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2023-12-15T17:05:25+00:00

    Both methods are tried. The log file mentioned is empty.

    The MSIExec /x /quiet method also fails.

    Are there specific steps to be followed when python is installed via the setup file and we wish to uninstall it ?

    0 comments No comments
  3. Anonymous
    2023-12-19T09:08:05+00:00

    You can check to see if there are such specific steps on the Python site. I removed the Python packages with Uninstall-Package and it worked as expected. Try repairing the installation using the Python installer, then run the Uninstall-Package cmdlet again.

    Also it seems the packages should be removed in some specific order. I removed the documents and libraries first, and the core interpreter and executables last.

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2024-05-02T06:22:09+00:00

    Thank you Ian. This helped us resolve the issue.

    0 comments No comments