【问题标题】:How to uninstall mini conda? python如何卸载迷你康达? Python
【发布时间】:2015-06-18 05:36:33
【问题描述】:

我已经安装了 conda 包:

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

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

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

【问题讨论】:

    标签: python pip uninstallation conda miniconda


    【解决方案1】:

    为了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
    

    【讨论】:

    • 如果您使用pip 将东西安装到 Miniconda Python 中,那么删除 Miniconda 目录也会删除它们。如果您将它们安装到另一个 Python 安装中,则不会。
    • 同时删除~/.bash_profile中的路径导出
    • 4.1.11 的 ~/.bashrc 中添加了路径
    • @bugmenot123 这取决于您的操作系统。对于 Linux,它位于 ~/.bashrc,而对于 MacOS(可能是 BSD),它位于 ~/.bash_profile。
    • 在 Windows 上使用卸载程序/应用程序的正常方式,但查找“Python X.X (Miniconda xxx)”。见conda docs
    【解决方案2】:

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

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

    然后运行:

    source ~/.bashrc
    

    【讨论】:

      【解决方案3】:

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

      【讨论】:

        【解决方案4】:

        完全卸载 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

        【讨论】:

        • anaconda-clean 实际上做了什么?
        【解决方案5】:

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

        【讨论】:

          猜你喜欢
          • 2016-07-08
          • 2015-06-27
          • 2013-12-08
          • 2014-11-04
          • 1970-01-01
          • 2012-05-05
          • 2010-10-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多