Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
5 of 8 tasks
morrisseyj opened this issue May 9, 2024 · 6 comments
Closed
5 of 8 tasks
Labels

Comments

@morrisseyj
Copy link

Checklist

  • I added a descriptive title.
  • I searched through existing issues and couldn't find a solution or duplicate issue.
  • I searched on the web (e.g. Google) and didn't find any helpful information.
  • I searched the Anaconda documentation and didn't find any helpful information.

Impacted product

  • A conda package (built by Anaconda)
  • Anaconda Distribution (formerly Anaconda Individual Edition)
  • Miniconda
  • Anaconda.org

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
Copy link

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.

  • Delete the directory you tried to install Miniconda into.
  • Type %USERPROFILE% into the Windows Exporer address field. You should see a .conda directory. If you do, open it and open the environments.txt file. Remove any lines that contain the directory of the failed Miniconda installation.
  • Remove the start menu folder. To do that, open the Windows Explorer and type %APPDATA%\Microsoft\Windows\Start Menu\Programs. If you see a Miniconda directory, go ahead and delete it.
  • Clean up environment variables. To get there, hit the Windows key and start typing "environment" and "Edit the system environment variables" should pop up. Click on that and then on the "Environment Variables" button at the bottom. Find Path and see if the Miinconda directory is in there. If so, edit the variable and remove it.
  • Remove a few things from the registry. Open the Registry Editor by hitting the Windows key and searching for it. If you installed it for "Just me", open the HKEY_CURRENT_USER folder on the side panel, otherwise HKEY_LOCAL_MACHINE.
    • Now go into Software\Microsoft\Windows\CurrentVersion\Uninstall and remove the Miniconda directory in there. This will remove it from the list of installed program in your applications list.
    • Under Software\Python\PythonCore. It may contain directories of the python version for your Miniconda installation. Open that directory and check InstallPath. If that points to the failed Miniconda installation, go ahead and remove the directory for the version.

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:

  • The Miniconda version
  • Whether you installing for "Just me" or "All users"
  • The installation directory

@morrisseyj
Copy link
Author

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

  • Can't recall the exact error message on original install.
  • I don't believe i had any other miniconda instalation on the system - i do however have another python installation on the system. At some point i tried to install anaconda, but that also failed - though it successfully uninstalled. I can't find any anaconda folder in C:\Users\[user]\AppData\Local or in C:\ProgramData (which was the install location for miniconda)
  • Deleted miniconda3 from C:\ProgramData and deleted miniconda from C:\Users\[user]\AppData\Local (does this mean i had installed two versions?)
  • No .conda folder in %USERPROFILE%
  • No miniconda directory in %APPDATA%\Microsoft\Windows\Start Menu\Programs
  • miniconda not on PATH
  • In the windows registry editor Software\Microsoft\Windows\CurrentVersion\Uninstall showed an Anaconda (not miniconda) directory - I deleted it
  • 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.

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
Copy link

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
Copy link
Author

@marcoesters Thanks again for your follow up.

  • No miniconda folder in C:\ProgramData\Microsoft\Windows\Start Menu\Programs
  • Since it seems i had installed for all users navigating through the registry via HKEY_LOCAL_MACHINE to Software\Microsoft\Windows\CurrentVersion\Uninstall, i find and delete Miniconda3 py312_24.1.2-0(Python 3.12.1 64 bit). Now miniconda no longer shows in the "Add/Remove" programs!
  • No Software\Python\PythonCore via HKEY_LOCAL_MACHINE
  • Back on \HKEY_CURRENT_USER\Software\Python\PythonCore i see no link to miniconda. The only subdirectories are: Help, Idle, IdleShortcuts, InstalledFeatures, InstallPath, PythonPath. Regarding python 3.9, i know i installed that to get another library working - nothing to do with miniconda.

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
Copy link

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
Copy link
Author

morrisseyj commented May 13, 2024

Will do. Thanks so much for your help!

New issue created regarding the ongoing install issues: #13386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants