MacOS – Uninstall Anaconda from macOS Big Sur

big surcommand linemacmacbook promacos

I've some question about uninstalling Anaconda from macOS Big Sur. I was wondering if someone can please help me figure it our what to do.
I followed the instruction on the official website (https://docs.anaconda.com/anaconda/install/uninstall/) plus some other guides, but I'm note an expert and I didn't reach my goal. That's what I did:

1) conda install anaconda-clean
2) anaconda-clean --yes
3) rm -rf ~/.condarc ~/.conda ~/.continuum
4) rm -rf ~/anaconda
5) conda remove -n myenv scipy
                         *PackagesNotFoundError
6) conda remove scipy
7) conda remove scipy curl
                         *PackagesNotFoundError
8) rm -rf ~/anaconda3
9) rm -rf ~/.anaconda_backup
10) export PATH=”/Users/MYUSERNAME/anaconda3/bin:$PATH
  1. At the end I've deleted the application throwing it in the trash and emptying it.

I'm not sure I did the right steps, maybe you can give me some advice. However, I didn't delete everything because I have still a folder in /opt path, /opt/anaconda3. I'm sure another folder was in /user/MYNAME, but I think I've deleted it, because I can't see it anymore, even in the hidden folders.

Then, if I run

conda list

lots of other packages are still available:

# packages in environment at /opt/anaconda3:
#
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0  
anaconda-clean            1.1.0            py37hecd8cb5_1  
anaconda-client           1.7.2                    py37_0  
[...] 
zlib                      1.2.11               h1de35cc_3  
zstd                      1.4.5                h41d2c2f_0

Also, conda still run in my terminal as I see (base) every time I open it, here an example:

(base) MYUSERNAME@MacBook ~ %

I also post the content inside .bash_profil, because maybe It can be related with "my terminal (base) problem":

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/opt/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/opt/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

I just wanted delete all the packages and files related to Anaconda.

Thanks in advance

Best Answer

This is a specific example of a common problem. Installers and applications that spray files and detritus all over the filesystem and rely on users to run many scripts, all changing weekly with version upgrades quickly becomes an intractable problem. You should be able to reclaim the 5 GB of space easily without worrying about some stub files and mostly empty config files.

Open the Terminal.app or iTerm2 terminal application, and then remove your entire Anaconda directory, which has a name such as anaconda2, anaconda3, or ~/opt. Enter rm -rf ~/anaconda3 to remove the directory.

If you’ve deleted the main program and the main folders (which I repeat above), I would say you’re good. Set up Time Machine so you’re backing up going forward and next time you want to install similar tool chains and environments, be sure you have a backup so you can roll back if that install gives poor results. Unless there’s a large file lying around you won’t gain anything cleaning up hundreds of files and other tools let you find folders and large files to clean them together.


In the unlikely event you have some issue caused by the leftover files, it’s less complicated and less time consuming to erase and reinstall a Mac and get your documents and apps reinstalled than it is to reconstruct what anaconda installed and surgically reverse every remnant left on the filesystem.

Worse, if you rm the wrong thing, you may delete more than you bargained for.

A safer bet is to substitute open for rm and you do need to recognize -rf or any flags passed to rm and delete them. Use the command line to open the folders rather than removing them is my advice if you don’t get exactly the syntax of the commands you are copy and paste into terminal. The writer of those guides assumes you know what the commands do or you won’t blame / sue them if you make an error and delete your home folder and all your pictures and documents.