ContinuumIO / anaconda-issues

Anaconda issue tracking
648 stars 224 forks source link

Can't uninstall miniconda (after failed install): "Failed to run pre_uninstall" #13381

Closed morrisseyj closed 6 months ago

morrisseyj commented 6 months ago

Checklist

Impacted product

What happened?

On Windows 11. I am trying to uninstall miniconda. I run the uninstaller but get the message: "Failed to run pre_uninstall". Note this was after a failed install when I got a similar message during the installer. Searching online i saw that you should just ignore this message, during the install. I did that but the install failed - I could not access conda from the cmd line. Now i can' uninstall.

If, during the uninstall, I ignore the "Failed to run pre_uninstall" prompt, I get another error: "Failed to run rmpath". If i ignore that i get another one: "Failed to run rmreg". If i ignore that, the uninstaller completes. I finish and exit, however miniconda remains in my programs - even though its not working.

I can't run conda info/conda config as conda did not install.

How can i clean everything up to try and get things installed correctly?

Expected behavior or outcome

Miniconda will uninstall.

Conda info

No response

Conda config

No response

Conda list

No response

Additional information

No response

marcoesters commented 6 months ago

Could you tell me which Miniconda installer you used and what the error during the installation was? Generally, those messages shouldn't be ignored because they point to actual problems.

There is a way to clean up the system manually. As with most Windows software, this is a little involved, but the steps are below. Depending on when the installation failed and which options you checked, some steps may not be necessary.

This assumes that you don't have any other Miniconda installation on the system before you tried to install it.

Once all that is done, your system should be free of Miniconda traces. Go ahead and run the installer again and let me know which error you are seeing. Things that will help debugging are:

morrisseyj commented 6 months ago

Thanks @marcoesters. Really appreciate the help. Here are the answers to your questions:

Miniconda still showing in add/remove programs (but for python 3.12.1), but when i click to uninstall, it can't be found. Tried rebooting and this persists. Should i uninstall/remove from the registry python 3.12? If so, how do i get 3.12.1 and leave 3.12.3 in tact?

Will hold off on reinstalling until i hear about this uninstall (and in case anything above changes your diagnosis). I assume i should get things removed before reinstalling them.

Thanks again for the help.

marcoesters commented 6 months ago

Deleted miniconda3 from C:\ProgramData and deleted miniconda from C:\Users[user]\AppData\Local (does this mean i had installed two versions?)

Possibly. I have no observed a Miniconda directory inside AppData\Local.

No miniconda directory in %APPDATA%\Microsoft\Windows\Start Menu\Programs

Since you installed into C:\ProgramData, you likely chose to install for "All Users". In this case, the directory could be inside C:\ProgramData\Microsoft\Windows\Start Menu\Programs.

In the windows registry editor Software\Python\PythonCore showed python 3.11 (along with 3.12.3 (which i can access by typing py at the command line) and 3.9, both of which i have installed separately), i removed 3.11.

We need to be careful here. Please make sure that the directory points to a Miniconda/Anaconda directory. I suspect that 3.12.3 belongs to your other Python installation. 3.9 may also be Miniconda/Anaconda, but please check before deleting it. This key has no consequence for the Miniconda installation though. It just assigns a Python executable when you use programs like VSCode and use the terminal, so you can also leave it alone.

Miniconda still showing in add/remove programs (but for python 3.12.1), but when i click to uninstall, it can't be found.

Yes, that is expected to fail. The entries in "add/remove programs" are just entries found in the Uninstall registry key and contains the command to uninstall the application. Since you removed the files, it cannot find the uninstaller.

However, that also means that we haven't found the entry yet. There are two possible locations: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall or HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall. Since you installed into C:\ProgramData, I suspect it is in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall, but go ahead and check both.

Will hold off on reinstalling until i hear about this uninstall (and in case anything above changes your diagnosis). I assume i should get things removed before reinstalling them.

Yes, that is prudent or debugging will get difficult. Since you already have another Python 3.12 installation on your system, I also suggest you use our Python 3.11 installer while we figure out what's going on: https://repo.anaconda.com/miniconda/Miniconda3-py311_24.3.0-0-Windows-x86_64.exe

morrisseyj commented 6 months ago

@marcoesters Thanks again for your follow up.

I fear that what happened is that i tried installing just for me. When that failed, i tried again for all users. I appreciate now that this was not prudent.

Ok, with all of this now as it is, should I look to install miniconda again with the Python 3.11 installer, or is there some other check to run to make sure the previous mess is fully cleaned up?

Thanks again.

marcoesters commented 6 months ago

Yes, I think you are good to go to install the python 3.11 version now.

Since the uninstallation problem is solved, I will go ahead and close this issue. If you run into problems installing, please open a new issue so that other users can easily find it.

Please include a screenshot of the error and paste the output of the log you see during the installation (right-click on the output and copy to clipboard - this will copy the entire log). Thanks!

morrisseyj commented 6 months ago

Will do. Thanks so much for your help!

New issue created regarding the ongoing install issues: https://github.com/ContinuumIO/anaconda-issues/issues/13386