问题:如何从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,请打开终端窗口:

  1. 删除整个anaconda安装目录:
rm -rf ~/anaconda
  1. 编辑~/.bash_profile 并从您的PATH环境变量中删除anaconda目录。

注意:您可能需要编辑.bashrc和/或.profile文件而不是.bash_profile

  1. 删除以下隐藏的文件和目录,这些文件和目录可能是在主目录中创建的:

    • .condarc
    • .conda
    • .continuum

用:

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

To uninstall Anaconda open a terminal window:

  1. Remove the entire anaconda installation directory:
rm -rf ~/anaconda
  1. 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

  1. 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

就我而言(Mac High Sierra),它安装在〜/ opt / anaconda3上。

https://docs.anaconda.com/anaconda/install/uninstall/

In my case (Mac High Sierra) it was installed at ~/opt/anaconda3.

https://docs.anaconda.com/anaconda/install/uninstall/


回答 3

打开终端,并输入以下命令,删除整个Anaconda目录,该目录的名称将为“ anaconda2”或“ anaconda3”,例如:rm -rf〜/ anaconda3。然后使用命令“ conda uninstall” https://conda.io/docs/commands/conda-uninstall.html删除conda 。

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

官方说明似乎在这里:https : //docs.anaconda.com/anaconda/install/uninstall/

但是,如果您喜欢我,由于某种原因而无法使用,并且由于某种原因您的conda却安装在其他地方,并告诉您这样做:

rm -rf ~/opt

我不知道为什么将它保存在那里,但这就是我的目的。


这对我修复conda安装很有用(如果这是您像我这样首先卸载它的原因):https : //stackoverflow.com/a/60902863/1601580最后为我修复了它。不知道为什么conda首先表现得很怪异,或者为什么错误地首先把东西安装了……

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…


声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。