112

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?
alvas
  • 115,346
  • 109
  • 446
  • 738

5 Answers5

127

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
merv
  • 67,214
  • 13
  • 180
  • 245
rth
  • 10,680
  • 7
  • 53
  • 77
  • 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 Apr 14 '15 at 17:46
  • 26
    Also remove the path export in your `~/.bash_profile` – math Oct 26 '15 at 20:10
  • 11
    Path is added in ~/.bashrc for 4.1.11 – bugmenot123 Nov 22 '16 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 Feb 27 '17 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](https://conda.io/docs/user-guide/install/windows.html#). – djvg Oct 03 '17 at 12:41
  • 1
    In my case it was `rm -r ~/miniconda3/ ` – markroxor Jun 26 '18 at 05:28
  • On my Mac it was `rm -r ~/opt/miniconda3/` and the path export was also added to `.zshrc`. – magic_al Aug 26 '22 at 06:27
98

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

tsveti_iko
  • 6,834
  • 3
  • 47
  • 39
  • 5
    What does anaconda-clean actually do though? – einpoklum Apr 07 '21 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` – Curious Watcher Apr 03 '22 at 17:36
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.

Sunil Mathew
  • 381
  • 1
  • 5
  • 13
5

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

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

and run:

source ~/.bashrc
Inspi
  • 530
  • 1
  • 4
  • 19
Jolth
  • 67
  • 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 Aug 17 '23 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.

divenex
  • 15,176
  • 9
  • 55
  • 55