135

I've install the conda package as such:

$ wget http://bit.ly/miniconda
$ bash miniconda
$ conda install numpy pandas scipy matplotlib scikit-learn nltk ipython-notebook seaborn

I want to uninstall it because it's messing up my pips and environment.

  • How do I uninstall conda totally?
  • Will it uninstall also my pip managed packages? If so, is there a way to uninstall conda safely without uninstalling packages managed by pip?
1

7 Answers 7

146

In order to uninstall miniconda, simply remove the miniconda folder,

rm -r ~/miniconda/

As for avoiding conflicts between different Python environments, you can use virtual environments. In particular, with Miniconda, the following workflow could be used,

$ wget https://repo.continuum.io/miniconda/Miniconda3-3.7.0-Linux-x86_64.sh -O ~/miniconda.sh
$ bash miniconda
$ conda env remove --yes -n new_env    # remove the environement new_env if it exists (optional)
$ conda create --yes -n new_env pip numpy pandas scipy matplotlib scikit-learn nltk ipython-notebook seaborn python=2
$ activate new_env
$ # pip install modules if needed, run python scripts, etc
  # everything will be installed in the new_env
  # located in ~/miniconda/envs/new_env
$ deactivate
7
  • 7
    If you used pip to install things into the Miniconda Python then removing the Miniconda directory will also remove them. If you installed them into another Python installation then it won't.
    – asmeurer
    Commented Apr 14, 2015 at 17:46
  • 27
    Also remove the path export in your ~/.bash_profile
    – math
    Commented Oct 26, 2015 at 20:10
  • 12
    Path is added in ~/.bashrc for 4.1.11 Commented Nov 22, 2016 at 18:08
  • 2
    @bugmenot123 This depends on your OS. For Linux it is in ~/.bashrc while for MacOS (and presumably BSDs) it is ~/.bash_profile.
    – absurd
    Commented Feb 27, 2017 at 20:31
  • 2
    On windows use the normal way of uninstalling a program/app, but look for "Python X.X (Miniconda xxx)". See conda docs.
    – djvg
    Commented Oct 3, 2017 at 12:41
127

The proper way to fully uninstall conda (Anaconda / Miniconda):

  1. Remove all conda-related files and directories using the Anaconda-Clean package

    conda activate your_conda_env_name
    conda install anaconda-clean
    anaconda-clean # add `--yes` to avoid being prompted to delete each one
    
  2. Remove your entire conda directory

    rm -rf ~/miniconda3
    
  3. Remove the line which adds the conda path to the PATH environment variable

    vi ~/.bashrc
    # -> Search for conda and delete the lines containing it
    # -> If you're not sure if the line belongs to conda, comment it instead of deleting it just to be safe
    source ~/.bashrc
    
  4. Remove the backup folder created by the the Anaconda-Clean package NOTE: Think twice before doing this, because after that you won't be able to restore anything from your old conda installation!

    rm -rf ~/.anaconda_backup
    

Reference: Official conda documentation

3
  • 8
    What does anaconda-clean actually do though?
    – einpoklum
    Commented Apr 7, 2021 at 11:36
  • 1
    @einpoklum Running anaconda-clean removes conda related material. Here's the output: (venv) user@HOME:~$ anaconda-clean Delete .conda? (y/n): y Backup directory: /home/user/.anaconda_backup/2022-04-03T203524 Delete .condarc? (y/n): y Delete .ipython? (y/n): y Delete .jupyter? (y/n): y Commented Apr 3, 2022 at 17:36
  • anaconda-clean removes files. The previous comment is not a comprehensive list.
    – merv
    Commented Feb 29 at 19:48
11

If you are using windows, just search for miniconda and you'll find the folder. Go into the folder and you'll find a miniconda uninstall exe file. Run it.

4

Update Sept 2023: Uninstalling Anaconda Distribution from MacOS

According to Official documentation you need to install anaconda-clean

conda install anaconda-clean

1. Run anaconda-clean

After installation run anaconda-clean to remove all Anaconda-related files and directories. It will ask for confirmation before deleting each file

# If you want to confirm each file and directory you are deleting
anaconda-clean

Or you can delete all files without confirmation with --yes argument

# If you don't want to be asked about each file and directory
anaconda-clean --yes

The anaconda-clean command also creates a backup of files in the home directory in a folder named .anaconda_backup

2. Delete all Conda related folder

The following are a few examples of how you may need to delete your Anaconda folder

rm -rf anaconda3
rm -rf ~/anaconda3
rm -rf ~/opt/anaconda3

3. Remove conda from PATH variables

if you have conda path set in ~/.profile, ~/.bash_profile or ~/.bash_login, remove it from there as well.

nano ~/.bashrc
nano ~/.profile
nano  ~/.zshrc

I hope that helps.

2
  • 3
    There is no longer a reference to anaconda-clean in the linked official documentation page. Based on archives, it was removed sometime in Oct/Nov 2023.
    – victorlin
    Commented Dec 5, 2023 at 22:10
  • anaconda-clean is just a file remover. No one needs to install it to remove Conda. See the files it cleans.
    – merv
    Commented Feb 29 at 19:45
2

your have to comment that line in ~/.bashrc:

#export PATH=/home/jolth/miniconda3/bin:$PATH

and run:

source ~/.bashrc
1
  • 1
    This only stops miniconda from being available system-wide. This does not uninstall it. Of course, you need to remove this line after you uninstall miniconda, but this is not the only thing you must do.
    – rayryeng
    Commented Aug 17, 2023 at 19:26
2

To update @Sunil answer: Under Windows, Miniconda has a regular uninstaller. Go to the menu "Settings/Apps/Apps&Features", or click the Start button, type "uninstall", then click on "Add or Remove Programs" and finally on the Miniconda uninstaller.

1
  • 2
    on my Mac (M2) Minicoda ( 4.12.0) was installed in ~/opt/miniconda/
    – Stephan
    Commented Oct 8, 2022 at 14:51
0

Adding to the list of possible installations: uninstalling standalone Mamba (or micromamba) from Windows is quite straightforward. Open the software installation catalogue "Apps & Features" and look for python. It should look like this.

uninstalling mamba from windows

After hitting uninstall you are guided through the process by the uninstaller.

Not the answer you're looking for? Browse other questions tagged or ask your own question.