簡體   English   中英

如何卸載迷你康達? 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 和環境。

  • 如何完全卸載 conda?
  • 它也會卸載我的 pip 管理的軟件包嗎? 如果是這樣,有沒有辦法在不卸載 pip 管理的軟件包的情況下安全卸載 conda?

為了卸載 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

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

參考:官方 conda 文檔

如果您使用的是 Windows,只需搜索 miniconda 即可找到該文件夾​​。 進入該文件夾,您將找到一個 miniconda 卸載 exe 文件。 運行。

您必須在 ~/.bashrc 中注釋該行:

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

並運行:

source ~/.bashrc

更新@Sunil 答案:在 Windows 下,Miniconda 有一個常規卸載程序。 轉到菜單“設置/應用程序/應用程序和功能”,或單擊“開始”按鈕,鍵入“卸載”,然后單擊“添加或刪除程序”,最后單擊 Miniconda 卸載程序。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM