After I updated my MacOS to latest version when I tried to follow uninstall steps listed on official anaconda document it didn’t work. I had to look through couple of articles on internet and finally one which worked for me is I am documenting here so you don’t have to go through all the same steps again. Enjoy !
So when we upgrade our OS, zsh bash profile is not updated and so our conda commands don’t work. To solve this first we run following commands in terminal.
curl -L https://repo.anaconda.com/pkgs/misc/cpr-exec/cpr-0.1.1-osx-64.exe -o cpr && chmod +x cpr ./cpr rehome ~/anaconda3
source ~/anaconda3/bin/activate
conda init zsh
So above command will activate your virtual environment and there you can use your conda command in your terminal. So now just following steps mentioned in official anaconda documentation will be pretty straight but remember there’s one important step so keep following me.
Now official documentation ask you to install new package called anaconda-clean which will basically help you to take easy backup before you uninstall completely. So to do that run this command.
conda install anaconda-clean
Now to take backup just run that package which you just installed.
anaconda-clean —yes
You’ll notice one new directory created name .anaconda_backup
Now this is important step, you have to deactivate virtual environment before you delete anaconda directory so run following command.
conda deactivate
Now you can remove anaconda directory by following command.
rm -rf ~/anaconda3
Also you can choose to remove conda path from your bash profile so you’ll have fresh installation next time if you want. Run following command and put # to comment line or just delete what is mentioned next.
sudo nano ~/.bash_profile
#export PATH=“/Users/your_username/anaconda3/bin:$PATH”
DONE !! Congratulation you have completely uninstalled anaconda from your MacOS.
Top comments (0)