Python - 如何在Windows 10上完全卸载Anaconda?

7
我的Anaconda安装出了一些问题。当我试图打开Jupyter时,发现开始菜单的快捷方式无效。当我点击它时,会弹出一个命令行窗口接着就关闭了。虽然我可以通过点击可执行文件来启动,但notebook会在一个奇怪的位置打开,而且我无法移动它。
当我尝试卸载和重新安装时,仍然出现相同的行为。我在 Stackoverflow 上找到了一些类似的问题(链接已经丢失),但是当我尝试使用提供的解决方案时,情况只有更加糟糕。我认为可能需要从 appdata 中删除某些东西,但这也没有解决问题。

1
你为什么认为你没有完全卸载它?在我看来,除非你有一些具体的证据表明相反,否则你的机器上可能存在其他需要解决的问题,这些问题不会仅通过重新安装软件就能解决。 - Silvio Mayolo
在Windows上卸载conda - srikavineehari
看起来有一个Windows更新删除了Anaconda所依赖的环境变量。我将在一台从未安装过它的机器上安装它,看看情况如何。 - Bob Wakefield
%USERPROFILE% 缺失是相当惊人的。这通常应该默认存在。也许是虚拟环境出了严重问题? - sytech
我可能在错误的地方寻找。我以为它是一个环境变量。我安装在一台没有它的机器上,但设置相同。快捷方式的目标指向一堆脚本,但最后使用了%USERPROFILE%,但当我查看环境变量时,没有这样的变量。 - Bob Wakefield
显示剩余7条评论
2个回答

11

我正在运行Windows 10专业版版本1703 OS Build 15063.786。我不确定是不是Windows更新引起了这个问题。最终,所有的快捷方式都指向了不存在的东西。我执行了以下任务。

  1. 使用标准的Windows卸载程序卸载Anaconda。
  2. 重新启动计算机。
  3. 彻底搜索硬盘,寻找任何与Anaconda安装有关的文件并手动删除它们。我记不清所有的确切文件夹了,但我确切地记得在C:\Users\Bob中有一个.Anaconda和一个.IPython和一个.Jupyter文件。所有这些都必须被删除。C:\Users\Bob\Anaconda3也必须手动删除,还有一些只是挂在C:\ProgramData\Anaconda3中的文件,无论如何都拒绝删除。
  4. 手动删除C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Anaconda3(64位)中的快捷方式。
  5. 重新启动计算机。
  6. 重新安装Anaconda。
  7. 重新启动计算机。

一切恢复正常。特别感谢sytech。检查环境变量没有提供解决方案,但它让我走上了正确的调查轨道。


4
我认为这是官方的解决方案:https://docs.anaconda.com/anaconda/install/uninstall/
[不幸的是,在我找到官方文章之前,我使用了简单的删除方法(在C:\ Users \ username \ Anaconda3中使用Uninstall-Anaconda.exe,遵循 stack overflow 中的答案),因此我必须手动清除所有内容。]
但对于其他人来说,官方的完整卸载过程可能会很有趣,因此我在此将其复制下来:

To uninstall Anaconda, you can do a simple remove of the program. This will leave a few files behind, which for most users is just fine. See Option A.

If you also want to remove all traces of the configuration files and directories from Anaconda and its programs, you can download and use the Anaconda-Clean program first, then do a simple remove. See Option B.

  1. Option A. Use simple remove to uninstall Anaconda:

    • Windows–In the Control Panel, choose Add or Remove Programs or Uninstall a program, and then select Python 3.6 (Anaconda) or your version of Python.
    • [... also solutions for Mac and Linux are provided here: https://docs.anaconda.com/anaconda/install/uninstall/ ]
  2. Option B: Full uninstall using Anaconda-Clean and simple remove.

    NOTE: Anaconda-Clean must be run before simple remove.

    • Install the Anaconda-Clean package from Anaconda Prompt (Terminal on Linux or macOS):

      conda install anaconda-clean
      
    • In the same window, run one of these commands:

      • Remove all Anaconda-related files and directories with a confirmation prompt before deleting each one:

        anaconda-clean
        
      • Or, remove all Anaconda-related files and directories without being prompted to delete each one:

        anaconda-clean --yes
        

      Anaconda-Clean creates a backup of all files and directories that might be removed in a folder named .anaconda_backup in your home directory. Also note that Anaconda-Clean leaves your data files in the AnacondaProjects directory untouched.

    • After using Anaconda-Clean, follow the instructions above in Option A to uninstall Anaconda.


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接