如何卸载mini conda?蟒蛇

alv*_*vas 43 python uninstall pip conda miniconda

我已经安装了conda包:

$ wget http://bit.ly/miniconda
$ bash miniconda
$ conda install numpy pandas scipy matplotlib scikit-learn nltk ipython-notebook seaborn
Run Code Online (Sandbox Code Playgroud)

我想卸载它,因为它弄乱了我的点子和环境.

  • 如何完全卸载conda?
  • 它会卸载我的pip托管包吗?如果是这样,有没有办法安全地卸载conda而不卸载由pip管理的软件包?

rth*_*rth 52

卸载miniconda,只需删除该miniconda文件夹,

rm -r ~/miniconda/
Run Code Online (Sandbox Code Playgroud)

这不应该删除你的任何pip安装包(但你应该检查virtualenv文件夹的内容以确认).

为了避免不同的python环境之间的冲突,你可以使用miniconda.特别是,使用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
Run Code Online (Sandbox Code Playgroud)

  • 同时删除`〜/ .bash_profile`中的路径导出 (9认同)
  • 如果您使用`pip`将东西安装到Miniconda Python中,那么删除Miniconda目录也将删除它们.如果您将它们安装到另一个Python安装中,那么它就不会. (7认同)
  • 在〜/ .bashrc中为4.1.11添加路径 (3认同)
  • @ bugmenot123这取决于您的操作系统.对于Linux,它位于〜/ .bashrc中,而对于MacOS(可能是BSD),它是〜/ .bash_profile. (2认同)
  • 在Windows上使用正常的卸载程序/应用程序的方式,但寻找"Python XX(Miniconda xxx)".请参阅[conda docs](https://conda.io/docs/user-guide/install/windows.html#). (2认同)

tsv*_*iko 31

完全卸载 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
    
    Run Code Online (Sandbox Code Playgroud)
  2. 删除整个 conda 目录

    rm -rf ~/miniconda3
    
    Run Code Online (Sandbox Code Playgroud)
  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
    
    Run Code Online (Sandbox Code Playgroud)
  4. 删除由 Anaconda-Clean 软件包创建的备份文件夹 注意:在执行此操作之前请三思,因为之后您将无法从旧的 conda 安装中恢复任何内容!

    rm -rf ~/.anaconda_backup
    
    Run Code Online (Sandbox Code Playgroud)

参考:官方 conda 文档

  • anaconda-clean 实际上做了什么? (2认同)

Sun*_*hew 7

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


小智 5

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

#export PATH=/home/jolth/miniconda3/bin:$PATH
Run Code Online (Sandbox Code Playgroud)

并运行:

source ~/.bashrc
Run Code Online (Sandbox Code Playgroud)