0

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

3
  • We can which anadonda (or type anaconda, or maybe something else for zsh) and it will tell us where the command is. It is strange that you kept anaconda3/bin in your path at step #10. /opt is also used by macPorts... maybe it was installed that way? We could spotlight search for anaconda and then do "Show all files..." to try to find left-overs. There's also a third-party application 'Find Any File' which searches for file names and other attributes. Applications store their files under Documents, Library, and Library/Application Support. – aMike Mar 27 at 13:33
  • I’m going to answer, just let it be. Unless you have a backup from before you installed this and it was only installed briefly, we would need to review every single thing you did to get the tool installed to answer this. Worse, if you run a correct command twice, you will get errors, they interact and you can’t delete a file twice. – bmike Mar 27 at 14:08
  • How did you install anaconda? (it was not via macports as that would be in /opt/local if there was a port for it) – mmmmmm Mar 27 at 17:53
0

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.

2
  • Thank you for your help @bmike . I tried to run rm -rfi ~/opt but it seems no folder exist. Do I digit the wrong path for the opt folder? I don't understand what ~ is for the path. I can see a folder in .opt/anaconda3 . Also, following the anaconda website, I installed anaconda-clean but seems it didn't do much. Unfortunately, the most annoying problem is conda running in the terminal, as I can see (base) in any terminal session. .bash_profil contain the script I found in, with references to conda. – Andrea Mar 27 at 14:36
  • See, I would not delete things in general @Andrea wait to determine that folder even takes enough space. The harm in deleting too much is too high. Don’t rm is my advice. Instead use open and have Finder show you what you have and drag the files to trash. You likely broke anaconda clean by trying other uninstall steps out of sequence (or just had a broken / incomplete installation in the first place). – bmike Mar 27 at 14:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .