列出所有环境

1
conda env list

创建环境

1
2
3
conda create -n <envName>
conda create -n <envName> python=<x.x> # 指定 python 版本
conda create -n <envName> --clone <envName> # 复制另一个环境

激活环境

1
conda activate <envName>

删除环境

1
conda env remove -n <envName>

pip 使用阿里云源

1
2
3
4
$ cat ~/.pip/pip.conf
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com

mac m1 使用 conda forge

很多包不支持 mac m1,需要安装miniconda,然后使用 conda forge

1
2
3
4
5
6
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install <package-name>

# 或者
conda install -c conda-forge <package-name>