Linux010 Miniconda安裝及使用

簡介

  • Conda 是一個開源的軟件包管理系統和環境管理系統,可以在多個操作系統上(包括 Linux,Mac OSX 和 Windows)使用,Conda 允許用戶可以從不同的 channels下載所需的軟件包,用戶也可以自己對 channels源進行配置。

  • Anaconda 是一個用于科學計算的 Python 發行版,支持 Linux, Mac, Windows, 包含了眾多流行的科學計算、數據分析的 Python 包。Anaconda 安裝包可以到 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 下載。

  • Miniconda 是一個 Anaconda 的輕量級替代,默認只包含了 python 和 conda,但是可以通過 pip 和 conda 來安裝所需要的包,Miniconda 安裝包可以到 https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/ 下載。

  • Bioconda是專門用來提供生信軟件的 channel,提供有超過7000個的生信軟件

Miniconda安裝包下載

image.png
  • 找到最新的Linux版本,復制地址
  • 使用wget命令下載軟件包
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_4.8.2-Linux-x86_64.sh
  • 下載完成后運行
bash Miniconda3-py38_4.8.2-Linux-x86_64.sh
conda config --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels bioconda
conda config --add channels r
conda config --add channels defaults
conda config --add channels conda-forge
  • 運行conda -V查看版本號,確認是否安裝成功

conda使用方法

usage: conda [-h] [-V] command ...

conda is a tool for managing and deploying applications, environments and packages.

Options:

positional arguments:
  command
    clean        Remove unused packages and caches.
    config       Modify configuration values in .condarc. This is modeled
                 after the git config command. Writes to the user .condarc
                 file (/home/caoqiansheng/.condarc) by default.
    create       Create a new conda environment from a list of specified
                 packages.
    help         Displays a list of available conda commands and their help
                 strings.
    info         Display information about current conda install.
    init         Initialize conda for shell interaction. [Experimental]
    install      Installs a list of packages into a specified conda
                 environment.
    list         List linked packages in a conda environment.
    package      Low-level conda package utility. (EXPERIMENTAL)
    remove       Remove a list of packages from a specified conda environment.
    uninstall    Alias for conda remove.
    run          Run an executable in a conda environment. [Experimental]
    search       Search for packages and display associated information. The
                 input is a MatchSpec, a query language for conda packages.
                 See examples below.
    update       Updates conda packages to the latest compatible version.
    upgrade      Alias for conda update.

optional arguments:
  -h, --help     Show this help message and exit.
  -V, --version  Show the conda version number and exit.

conda commands available from other packages:
  env

安裝conda后取消命令行前出現的base,取消每次啟動自動激活conda的基礎環境

  • 方法一:
# 退出base環境回到系統自動的環境
conda deactivate
  • 方法二
# 永久關閉默認啟動base
conda config --set auto_activate_base false
# 激活base
conda activate base
# 恢復默認啟動base
conda config --set auto_activate_base true
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。