如何卸载迷你康达? python

How to uninstall mini conda? python

我已经安装了 conda 包:

$ wget http://bit.ly/miniconda
$ bash miniconda
$ conda install numpy pandas scipy matplotlib scikit-learn nltk ipython-notebook seaborn

我想卸载它,因为它弄乱了我的 pips 和环境。

为了uninstall miniconda,只需删除miniconda文件夹,

rm -r ~/miniconda/

至于避免不同Python环境之间的冲突,您可以使用虚拟环境。特别是,对于 Miniconda,可以使用以下工作流程,

$ wget https://repo.continuum.io/miniconda/Miniconda3-3.7.0-Linux-x86_64.sh -O ~/miniconda.sh
$ bash miniconda
$ conda env remove --yes -n new_env    # remove the environement new_env if it exists (optional)
$ conda create --yes -n new_env pip numpy pandas scipy matplotlib scikit-learn nltk ipython-notebook seaborn python=2
$ activate new_env
$ # pip install modules if needed, run python scripts, etc
  # everything will be installed in the new_env
  # located in ~/miniconda/envs/new_env
$ deactivate

您必须在 ~/.bashrc 中注释该行:

#export PATH=/home/jolth/miniconda3/bin:$PATH

和运行:

source ~/.bashrc

如果您使用的是 windows,只需搜索 miniconda 即可找到该文件夹​​。进入文件夹,你会发现一个 miniconda 卸载 exe 文件。 运行它。

完全卸载conda(Anaconda / Miniconda)的正确方法:

  1. 使用 Anaconda-Clean 包删除所有与 conda 相关的文件和目录

    conda activate your_conda_env_name
    conda install anaconda-clean
    anaconda-clean # add `--yes` to avoid being prompted to delete each one
    
  2. 删除整个 conda 目录

    rm -rf ~/miniconda3
    
  3. 删除将 conda 路径添加到 PATH 环境变量的行

    vi ~/.bashrc
    # -> Search for conda and delete the lines containing it
    # -> If you're not sure if the line belongs to conda, comment it instead of deleting it just to be safe
    source ~/.bashrc
    
  4. 删除Anaconda-Clean包创建的备份文件夹 注意:在执行此操作之前请三思,因为之后您将无法从旧的 conda 安装中恢复任何内容!

    rm -rf ~/.anaconda_backup
    

参考:Official conda documentation

更新@Sunil 的回答:在Windows 下,Miniconda 有一个常规的卸载程序。转到菜单“Settings/Apps/Apps&功能”,或单击“开始”按钮,键入“卸载”,然后单击“添加或删除程序”,最后单击 Miniconda 卸载程序。