问题:如何从macOS完全卸载Anaconda
如何从MacOS Sierra完全卸载Anaconda并恢复为原始Python?我试过使用,conda-clean -yes
但不起作用。我也删除了其中的内容,~/.bash_profile
但是它仍然使用Anaconda python,并且我仍然可以运行conda
命令。
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.
回答 0
删除配置:
conda install anaconda-clean
anaconda-clean --yes
删除配置后,您可以删除anaconda安装文件夹,该文件夹通常位于主目录下:
rm -rf ~/anaconda3
另外,该anaconda-clean --yes
命令还会在您的主目录中以格式创建备份~/.anaconda_backup/<timestamp>
。确保也删除该一个。
编辑(v5.2.0):现在,如果您要清除所有内容,则还必须删除添加到的最后两行.bash_profile
。他们看着像是:
# added by Anaconda3 5.2.0 installer
export PATH="/Users/ody/anaconda3/bin:$PATH"
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"
回答 1
要卸载Anaconda,请打开终端窗口:
- 删除整个anaconda安装目录:
rm -rf ~/anaconda
- 编辑
~/.bash_profile
并从您的PATH
环境变量中删除anaconda目录。
注意:您可能需要编辑.bashrc
和/或.profile
文件而不是.bash_profile
删除以下隐藏的文件和目录,这些文件和目录可能是在主目录中创建的:
.condarc
.conda
.continuum
用:
rm -rf ~/.condarc ~/.conda ~/.continuum
To uninstall Anaconda open a terminal window:
- Remove the entire anaconda installation directory:
rm -rf ~/anaconda
- Edit
~/.bash_profile
and remove the anaconda directory from your PATH
environment variable.
Note: You may need to edit .bashrc
and/or .profile
files instead of .bash_profile
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
回答 2
回答 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
这是anaconda在删除Anaconda之后有一个条目破坏了我的python安装的地方。希望这对其他人有帮助。
如果您使用的是纱,我在〜/“用户名”的.yarn.rc文件中找到了此条目
python“ / Users / someone / anaconda3 / bin / python3”
删除此行固定了彻底删除所需的最后一个位置。我不确定如何添加该条目,但它有帮助
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
在执行了辣木和jkysam的非常有用的建议而没有立即获得成功后,需要简单地重新启动Mac才能使系统识别出更改。希望这对某人有帮助!
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
这对我有用:
conda remove --all --prefix /Users/username/anaconda/bin/python
然后从.bash_profile中的$ PATH中删除
This has worked for me:
conda remove --all --prefix /Users/username/anaconda/bin/python
then also remove from $PATH in .bash_profile
回答 7
在我的〜/ .bash_profile文件中添加export PATH="/Users/<username>/anaconda/bin:$PATH"
(或export PATH="/Users/<username>/anaconda3/bin:$PATH"
如果您有anaconda 3),可以为我解决此问题。
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.
回答 8
The official instructions seem to be here: https://docs.anaconda.com/anaconda/install/uninstall/
but if you like me that didn’t work for some reason and for some reason your conda was installed somewhere else with telling you do this:
rm -rf ~/opt
I have no idea why it was saved there but that’s what did it for me.
This was useful to me in fixing my conda installation (if that is the reason you are uninstalling it in the first place like me): https://stackoverflow.com/a/60902863/1601580 that ended up fixing it for me. Not sure why conda was acting weird in the first place or installing things wrongly in the first place though…