PowerShell script to completely remove any preexisting user or system-wide installations of Anaconda and/or Miniconda. Does the following:
- Searches for user or system installations of Anaconda or Miniconda from common install locations.
- For each detected installation, removes
pkgs
andenvs
directories (if present). - Looks for and attempts to run the uninstaller. Deletes install directory if uninstaller fails or is not found.
- Deletes all user configuration files as the
anaconda-clean
tool would. - Deletes additional common user and system configuration files from
%APPDATA%
and%ProgramData%
. - Removes ALL Python-related registry keys (you will need to restore any non-conda Python registry keys).
- Removes all invalid and conda-related entries from both user and system PATH. (Any entries that do not resolve to an existing directory will be removed.)
- Clears the Start menu of any conda-related entries.
When running on a multi-user system, note that the script only removes user-based installs and user configuration files for the user running the script. This means that any configuration files resulting from a system-wide installation will still be present in other user accounts.
To run the script, run the following commands in an elevated (administrator) PowerShell:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/ukukas/condaremove/main/condaremove.ps1" -OutFile "~\condaremove.ps1"
Invoke-Expression ~\condaremove.ps1
Remove-Item ~\condaremove.ps1