How to uninstall Anaconda completely from macOS

左心房为你撑大大i 提交于 2019-11-26 04:59:08

问题


How can I completely uninstall Anaconda from MacOS Sierra and revert back to the original Python? I have tried using conda-clean -yes but that doesn\'t work. I also remove the stuff in ~/.bash_profile but it still uses the Anaconda python and I can still run the conda command.


回答1:


To remove the configs:

conda install anaconda-clean
anaconda-clean --yes

Once the configs are removed you can delete the anaconda install folder, which is usually under your home dir:

rm -rf ~/anaconda3

Also, the anaconda-clean --yes command creates a backup in your home directory of the format ~/.anaconda_backup/<timestamp>. Make sure to delete that one also.


EDIT (v5.2.0): Now if you want to clean all, you will also have to delete the two last lines added to your .bash_profile. They look like:

# added by Anaconda3 5.2.0 installer
export PATH="/Users/ody/anaconda3/bin:$PATH"



回答2:


To uninstall Anaconda open a terminal window and remove the entire anaconda install directory:

rm -rf ~/anaconda

Edit*:

~/.bash_profile

and remove the anaconda directory from your PATH environment variable.

Remove the following hidden files and directories, which may have been created in the home directory:

  • .condarc
  • .conda
  • .continuum

Use:

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

* You may need to edit .bashrc and/or .profile instead




回答3:


Open the terminal and remove your entire Anaconda directory, which will have a name such as “anaconda2” or “anaconda3”, by entering the following command: rm -rf ~/anaconda3. Then remove conda with command "conda uninstall" https://conda.io/docs/commands/conda-uninstall.html.




回答4:


This is one more place that anaconda had an entry that was breaking my python install after removing Anaconda. Hoping this helps someone else.

If you are using yarn, I found this entry in my .yarn.rc file in ~/"username"

python "/Users/someone/anaconda3/bin/python3"

removing this line fixed one last place needed for complete removal. I am not sure how that entry was added but it helped




回答5:


After performing the very helpful suggestions from both spicyramen & jkysam without immediate success, a simple restart of my Mac was needed to make the system recognize the changes. Hope this helps someone!




回答6:


This has worked for me:

conda remove --all --prefix /Users/username/anaconda/bin/python

then also remove from $PATH in .bash_profile




回答7:


Adding export PATH="/Users/<username>/anaconda/bin:$PATH" (or export PATH="/Users/<username>/anaconda3/bin:$PATH" if you have anaconda 3) to my ~/.bash_profile file, fixed this issue for me.



来源:https://stackoverflow.com/questions/42182706/how-to-uninstall-anaconda-completely-from-macos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!