5

When I run winget list python I get that Python.Python.3 is installed by winget; however, running python says the executable is missing.

winget uninstall --id Python.Python.3 runs the uninstaller but the uninstaller halts and does not complete.

Is there a way to force the complete removal of a corrupted winget package installation?

2
  • I would just reinstall the package. I don't know the exact command, but I am sure, there is a way to force install the package so you can uninstall it. Since this package wouldn't actually use the registry you can also just remove the folder that contains the exectuable.
    – Ramhound
    Commented May 6, 2022 at 15:40
  • @Ramhound the --force flag is to ignore hash mismatches. Yes, the un/install runs, however was halting. I posted a solution I found. Please let me know your thoughts. Thank you. docs.microsoft.com/en-us/windows/package-manager/winget/…
    – treedust
    Commented May 16, 2022 at 2:27

1 Answer 1

5

Summary: winget thought Python.Python.3 was still installed because of a regedit key sticking around, hence why winget list python reports it being installed. The uninstaller was a remnant from a previously malformed uninstallation (most likely from the same reason a regedit key was still existing).

Solution: Removing the Python.Python.3 package's Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall regedit (Registry Editor) key resulted in allowing to re-install the package via winget install --id Python.Python.3.

4
  • The key is empty. I had to delete the application via appwiz.cpl and it's finally gone. Commented Jan 25 at 4:01
  • @MartinBraun did you remove the empty key before uninstalling?
    – treedust
    Commented Jan 26 at 0:14
  • almost stock Windows, never touched the registry. But the machine was off for a while, I tried to uninstall vim.vim which I installed months ago. The key was entirely empty in the registry, but gVim was still listed in appwiz.cpl. There was a CDN change at winget that might be the culprit for the initial issues, I had to reinstall winget, but the package was still broke. Commented Jan 26 at 6:46
  • @MartinBraun please try deleting the empty key. Not sure if there was a command you were able to run via appwiz.cpl, if so could you please provide it? For me deleting the listing in appwiz.cpl resulted in running the uninstaller which halts.
    – treedust
    Commented Jan 26 at 17:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .