How to uninstall Anaconda

Uninstalling Anaconda Distribution removes a large user-owned Python stack, so the first decision is whether project environments and shared Conda settings should survive. A complete cleanup backs up anything needed later, removes the base prefix with Anaconda's uninstaller, and verifies that new shells no longer find conda.

Current macOS and Linux Anaconda installers include an uninstall.sh script in the base prefix. The script removes packages from the prefix and can also remove caches, user config files, and user data when given cleanup flags. Windows installs should be removed with the Windows Anaconda uninstaller instead of these terminal commands.

The cleanup flags can remove home-directory files that another Conda installation still uses. Keep ~/.condarc, ~/.conda, or external environment directories when they belong to another Anaconda, Miniconda, Mambaforge, or shared workstation setup.

Steps to uninstall Anaconda Distribution on macOS or Linux:

  1. Open a terminal that can still run conda.
  2. Export any environment that must be recreated later.
    $ conda env export --name analysis > analysis.yml

    Repeat the export for each named environment that should survive the uninstall.
    Related: Export a Conda environment to YAML

  3. List Conda environments and identify anything outside the Anaconda base directory.
    $ conda info --envs
    # conda environments:
    #
    base                 * /home/user/anaconda3
    analysis               /home/user/anaconda3/envs/analysis
    gpu                    /srv/conda/envs/gpu

    Directories outside the base prefix are not removed by deleting /home/user/anaconda3. Remove only the external environment directories that no other user or Conda installation needs.

  4. Find the Anaconda base directory.
    $ conda info --base
    /home/user/anaconda3
  5. Leave the active base environment.
    $ conda deactivate

    No output is normal. The terminal prompt should no longer start with (base).

  6. Run the Anaconda uninstaller from the base directory.
    $ ~/anaconda3/uninstall.sh --yes --remove-caches --remove-config-files user --remove-user-data
    Uninstalling conda installation in /home/user/anaconda3...
    Running conda init --reverse...
    No action taken.
    Removing environments...
    ##### snipped #####
    Cleaning cache directories.
    Removing .condarc files...
    Removing user data...

    The --remove-config-files user and --remove-user-data flags remove home-directory Conda settings and data. Omit them when another Conda installation still uses those files. If conda info –base points to /opt/anaconda3 or another root-owned path, run the same command with that exact path through sudo -E. If uninstall.sh is missing, the installation was probably created with an older Anaconda Distribution installer and needs the manual removal path from Anaconda's uninstall documentation.

  7. Confirm the install directory is gone.
    $ test ! -d ~/anaconda3 && echo "Anaconda installation directory removed"
    Anaconda installation directory removed

    Replace ~/anaconda3 with the base path printed earlier when the installation used a different directory.

  8. Open a new terminal.
  9. Verify conda is no longer on PATH.
    $ conda --version
    bash: conda: command not found

    If this prints another Conda version, another installation is still on PATH. Run conda info –base before removing anything else.