命令大全

fansichao 2021-10-23 16:25:17
Categories: Tags:

常用命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

# 检查版本
conda --version
# 升级版本
conda update conda

# 创建环境
conda create --name xxxx python=3.9
# 查看所有环境
conda info -envs
# 复制环境
conda create -n xxx --clone xxxx
# 删除环境
conda remove -n xxxx
# 查看已安装包
conda list

# 向指定环境中安装包
conda install ---name env_xx xlrd_xxx
# 删除指定环境包
conda remove -n env_xxx xlrd_xxx
# 删除环境
conda remove -n env_xxx --all




Win 命令

1
2
3
4
# 激活环境
activate xxxxx


Linux 命令

1
2
# 激活环境
source activate xxxx

功能模块

配置国内镜像源

1
2
3
4
5
6
7
8
9
# 为 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/pkgs/main/
conda config --set show_channel_urls yes


# 为 pip 添加国内镜像源
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

修改镜像源

1
2
3
4
5
6
7
8
9
10
11
12
13

# 添加阿里云源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
#设置搜索时显示通道地址
conda config --set show_channel_urls yes

# 移除
conda config --remove channels xxxx

# 移除全部
conda config --remove channels