How to uninstall or remove Anaconda completely from macOS

How to uninstall or remove Anaconda completely from macOS

Image for postPhoto by Markus Spiske on Unsplash

Anaconda is a free and open-source distribution of the Python and R programming languages that is widely used among the Data Science, Machine Learning and Artificial Intelligence communities. However, due to its wide distribution, sometimes there is a need for complete removal or uninstall.

Here are some simple guides on how to uninstall or remove Anaconda completely from macOS computers.

Option A: Use simple remove to uninstall Anaconda:

Delete the anaconda install folder, which is usually under your home directory from your terminal:

*For macOS (High Sierra), Anaconda is installed at ~/opt/anaconda3.

rm -rf ~/anaconda3

Once you removed all the Anaconda files, you may want to remove the following lines from your .bash_profile

Go to terminal and type:

nano ~/.bash_profile

and delete the following lines:

# added by Anaconda3 2019.10 installer# >>> conda init >>># !! Contents within this block are managed by ?conda init? !!__conda_setup=?$(CONDA_REPORT_ERRORS=false ?/Users/khpoo/opt/anaconda3/bin/cond$if [ $? -eq 0 ]; then eval ?$__conda_setup?else if [ -f ?/Users/khpoo/opt/anaconda3/etc/profile.d/conda.sh? ]; then . ?/Users/khpoo/opt/anaconda3/etc/profile.d/conda.sh? CONDA_CHANGEPS1=false conda activate base else export PATH=?/Users/khpoo/opt/anaconda3/bin:$PATH? fifiunset __conda_setup# <<< conda init <<<

The press control+X to save and exit.

Option B: Full uninstall using Anaconda-Clean and simple remove

The second option is to run Anaconda-Clean before doing any removal.

Install the Anaconda-Clean package from Anaconda Prompt of macOS terminal:

conda install anaconda-clean

In the same window, run the anaconda-clean command to remove all Anaconda-related files and directories with a confirmation prompt before deleting each one:

anaconda-clean

or remove all Anaconda-related files and directories without being prompted to delete each one:

anaconda-clean –yes

Lastly, you may want to remove the following hidden files and directories, which may have been created in the home directory:

  • .condarc
  • .conda
  • .continuum

Use the following commands:

rm -rf ~/.condarc ~/.conda ~/.continuum

Good luck!. If you have any other methods, please share it in comment below.

1

No Responses

Write a response