HOWTO · Python
How to Uninstall Miniconda Completely
Safely uninstall Miniconda on Windows, macOS, or Linux while preserving environments you want to keep and removing optional leftovers only when needed.
On this page
To uninstall Miniconda safely, first export any environment you want to keep, identify the exact installation prefix, and then use the operating-system-specific uninstaller. Remove shell settings and conda user data only if you intentionally want a clean reset: those optional steps can discard settings and cached packages.
Back Up Environments and Identify the Installation Prefix
Uninstalling a Miniconda installation removes the environments and packages stored inside that installation directory. Before continuing, export an environment that you may want to recreate later. For example, run conda env export --name myenv > myenv.yml and keep myenv.yml outside the Miniconda directory. After reinstalling conda, you can recreate it with conda env create --file myenv.yml.
Do not delete a directory merely because its name looks like Miniconda. On macOS and Linux, ask conda for the base prefix first. The following preflight prints the directory when conda is available and stops before any deletion when it is not:
if ! prefix="$(conda info --base 2>/dev/null)"; then
printf '%s\n' 'conda is not on PATH; find the installation prefix before deleting anything.'
exit 1
fi
printf 'Miniconda prefix: %s\n' "$prefix"
For a working installation, the last line has this form:
Miniconda prefix: /opt/miniconda3
If the preflight says that conda is not on PATH, do not substitute a guessed path into a removal command. Locate the original installer directory first, or use the uninstaller supplied with that installation. This boundary case is deliberately conservative: deleting the wrong prefix can remove a different conda installation.
Uninstall Miniconda on Windows
Use the Windows uninstaller that came with the Miniconda installation. Open Settings > Apps > Installed apps (or Apps & features on older Windows), select Miniconda, and choose Uninstall. The Anaconda Miniconda uninstall guide documents the current supported procedure.
Close Command Prompt, PowerShell, IDE terminals, and Python processes that use this installation before starting. When the uninstaller finishes, open a new terminal and run where conda. A message that no matching executable was found is the expected result when this was your only conda installation. If it still finds a path, inspect that path: it may belong to a separate Anaconda, Miniconda, or Miniforge installation that you should not remove accidentally.
Uninstall Miniconda on macOS or Linux
For an installer that provides it, run the uninstall.sh script from the exact Miniconda prefix you identified. Follow the prompts from that script rather than copying a generic rm -rf command. The official uninstall guide separates this supported removal from optional cleanup because uninstallers can leave user-level configuration behind.
If the uninstaller is unavailable, manual deletion is a fallback, not the first choice. Recheck the prefix, make sure it is the Miniconda installation you intend to remove, and then remove that one directory. The conda documentation describes the manual approach and its optional cleanup steps for macOS. rm -rf does not ask for confirmation and cannot be undone; never run it with an empty, unverified, or broad path such as your home directory.
After the removal, open a new shell and run command -v conda. No output means the command is no longer found through the current PATH. If it prints a path, either another conda installation remains or your shell has retained an initialization entry.
Remove Optional Shell and User-Data Leftovers
The core uninstall does not require deleting all conda-related files. Choose these steps only when you want to reset conda for the user account:
- Reverse shell initialization with
conda init --reverse --allbefore removing the installation, whencondais still available. Alternatively, remove only the conda initialization block from the relevant shell startup file after reviewing it. - Consider removing
.condarc,.conda, and.continuumonly if you do not need their settings, cached packages, or other user-level state. Keep a copy first if you are unsure. - Check shell files such as
.bashrc,.zshrc, or the PowerShell profile for stale Miniconda paths. Remove just the lines that refer to the installation you removed, then start a new terminal.
Do not use anaconda-clean as the primary Miniconda uninstaller. It is a cleanup utility, while the supported uninstaller or a carefully verified manual fallback addresses the installation itself. Optional cleanup is useful when reinstalling from scratch, but it is not necessary just to reclaim the Miniconda directory.
Verify the Result and Reinstall if Needed
Verification should show that the removed prefix is gone and that a fresh terminal no longer resolves conda or the old Python executable from that prefix. On Windows, use where conda; on macOS or Linux, use command -v conda. If a command still resolves, compare the reported location with the prefix you removed before changing PATH or deleting anything else.
You can reinstall Miniconda later without restoring old configuration files. Create a new environment from the saved YAML file when needed. If removal fails because a file is in use or permission is denied, close programs using that installation and rerun the supported uninstaller with the appropriate account permissions; do not force-delete a path you have not verified.