官网: https://docs.conda.io/projects/conda/en/stable/user-guide/getting-started.html
# 安装
---
1. Run the following four commands to download and install the latest Linux installer for your chosen chip architecture. Line by line, these commands:
```
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm ~/miniconda3/miniconda.sh
```
2. After installing, close and reopen your terminal application or refresh it by running the following command:
```
source ~/miniconda3/bin/activate
```
3. Then, initialize conda on all available shells by running the following command:
```
conda init --all
```
# 使用
---
```
# 介绍
介绍
conda是一个配置隔离 python 环境的工具.
conda只是一个工具, 它有两个发型版本, 分别是 Anaconda 和 Miniconda.
频道 (todo)
conda 频道是存储包的位置,安装包时 conda 会搜索现有的频道集合,并选取其中一个频道来安装包。
conda 的默认频道是https://repo.anaconda.com/pkgs/,但该频道需要付费,我们一般使用conda-forge这个频道来进行安装,它是免费的。
# 常用命令
conda -h
# 列出当前所有的 conda 环境。
conda info -e
# 安装包
conda install xxx
conda install --yes --file requirements.txt
# 用来创建新的 conda 环境
conda create -n my_env
conda activate my_env
# 查看该环境下都安装了哪些包
conda list
# 只列出指定相关的包
conda list numpy
# 退出环境
conda deactivate
# 克隆(复制)现有的环境
conda create -n new_env --clone /home/tiger/original_env
# 创建的环境, 并安装新的包
conda create -n my_env python numpy flask
# 指定 python 版本
conda create -n my_env python=3.9.7 numpy flask
# 移除 conda 环境中的某些包
conda remove numpy
# 移除所有包
conda remove --all
# 搜索指定的包
conda search [-c channel_address] [-f] [packages]
# 升级到最新版本
conda update numpy scipy
# 升级依赖包
conda env update -f local.yml
# 第一步:首先退出环境
conda deactivate
# 第二步:删除环境
conda remove -n 需要删除的环境名 --all
```

Conda安装与使用