conda是什么
- 一种在linux系统上的APP store(就是在linux上运行的一种应用程序) ,可以下载、安装软件,由于conda是国外网站,所以需要在conda 上加载一个国内镜像通道进行下载任务。
#清华大学开源软件镜像站
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
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/cloud/bioconda
conda config --set show_channel_urls yes
- conda 有三种版本anaconda\miniconda\conda,生信使用最多的是miniconda
怎么下载conda
-
首先了解电脑服务器多少位
unama -a
- 下载新版本
-
找到miniconda安装包入口,找latest-linux-x86_64版本
-
单击下载该版本,得到网址并复制
登录linux,进入biosoft
输入
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
下载完毕
怎么安装conda
-
安装
(千万不要为了快一直按着enter,会错过输入yes)
输入
bash Miniconda3-latest-Linux-x86_64.sh(bash+需要安装软件的名称)
(base) bio03@VM-0-6-ubuntu:~/biosoft$ bash Miniconda3-latest-Linux-x86_64.sh
Welcome to Miniconda3 py38_4.9.2
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
===================================
End User License Agreement - Anaconda Individual Edition
===================================
Copyright 2015-2020, Anaconda, Inc.
All rights reserved under the 3-clause BSD License:
This End User License Agreement (the "Agreement") is a legal agreement between y
ou and Anaconda, Inc. ("Anaconda") and governs your use of Anaconda Individual E
dition (which was formerly known as Anaconda Distribution).
按enter 跳过一大串版本信息后
得到
conda config --set auto_activate_base false
Thank you for installing Miniconda3!
胜利o(´^`)o
-
激活!
输入source ~/.bashrc
验证激活成功:输入conda后出现满屏信息
(base) bio03@VM-0-6-ubuntu:~/biosoft$ source ~/.bashrc
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda
-
添加镜像网站
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
Warning: 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free' already in 'channels' list, moving to the top
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
Warning: 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge' already in 'channels' list, moving to the top
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
Warning: 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda' already in 'channels' list, moving to the top
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda config --set show_channel_urls yes
怎么使用conda安装软件、删除软件
-
看所有已安装软件
conda list
-
找一个软件
conda search fastqc(fastqc是一个软件名字)
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda list
# packages in environment at /home/bio03/miniconda3:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main defaults
brotlipy 0.7.0 py38h27cfd23_1003 defaults
ca-certificates 2020.10.14 0 defaults
certifi 2020.6.20 pyhd3eb1b0_3 defaults
cffi 1.14.3 py38h261ae71_2 defaults
chardet 3.0.4 py38h06a4308_1003 defaults
conda 4.9.2 py38h06a4308_0 defaults
conda-package-handling 1.7.2 py38h03888b9_0 defaults
cryptography 3.2.1 py38h3c74f83_1 defaults
idna 2.10 py_0 defaults
ld_impl_linux-64 2.33.1 h53a641e_7 defaults
-
安装一个软件
conda install fastqc -y
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda install fastqc -y
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.9.2
latest version: 4.10.1
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: /home/bio03/miniconda3
added / updated specs:
- fastqc
不加 -y:要自己在安装过程中手动键入y
-
删除一个软件
conda remove fastqc -y
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda remove fastqc -y
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /home/bio03/miniconda3
removed specs:
- fastqc
The following packages will be downloaded:
package | build
---------------------------|-----------------
_libgcc_mutex-0.1 | conda_forge 3 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
_openmp_mutex-4.5 | 1_gnu 22 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
brotlipy-0.7.0 |py38h497a2fe_1001 341 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
cffi-1.14.5 | py38ha65f79e_0 227 KB https://mirror
conda环境
- 理解:就是把conda划分成多个区域,把同一软件不同版本安装在不同区域,执行不同操作,互不干扰。(相当于分屏操作)
-
查看环境
conda info --envs
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda info --envs
# conda environments:
#
base * /home/bio03/miniconda3
*☞默认所处区域
-
建立一个名为rna_seq 的区域
- 输入conda create -n rna-seq python=3 fastqc rimmomatic -y
(“python=3”☞这个区域是python3版本的;“fastqc trimmomatic ”☞划分区域的同时将名为fastqc 和 timmomatic两个软件安装在rna_seq区域中)
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda create -n rna-seq python=3 fastqc trimmomatic -y
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /home/bio03/miniconda3/envs/rna-seq
added / updated specs:
- fastqc
- python=3
- trimmomatic
The following packages will be downloaded:
package | build
---------------------------|-----------------
certifi-2020.12.5 | py39hf3d152e_1 143 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
fontconfig-2.13.1 | hba837de_1005 357 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
freetype-2.10.4 | h0708190_1 890 KB https://mirror
- 查看当前区域
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda info --envs
# conda environments:
#
base * /home/bio03/miniconda3
rna-seq /home/bio03/miniconda3/envs/rna-seq
- 激活并查看新区域
conda activate rna-seq
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda activate rna-seq
(rna-seq) bio03@VM-0-6-ubuntu:~/biosoft$ conda info --envs
# conda environments:
#
base /home/bio03/miniconda3
rna-seq * /home/bio03/miniconda3/envs/rna-seq
- 退出rna-seq
conda deactivate