1.conda --version
检查conda版本
2.conda env list
列出所有环境
3.conda env remove -n env_name
删除指定环境
4.conda create -n py36 python=3.6 anaconda
创建新的环境,‘py36’为环境名;‘python=3.6’为指定的python版本,也可以指定其他模块的版本,如:‘numpy=1.7’;‘anaconda’为元包(metapackage),包含所有anaconda中的python包,而且是对应指定python版本的(python 3.6)
5.conda activate py36
切换到‘py36’环境
6.conda deactivate
退出当前环境
7.conda list/pip list
查看当前环境安装的包
8.conda install requests
安装requests模块
9.清华镜像
- 重置
conda config --remove-key channels - 添加清华源
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/pytorch/
conda config --set show_channel_urls yes - 查看效果
cat ~/.condarc(windows系统在C:\Users\name\condarc
) - 备注
创建环境时若出现bug:CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.continuum.io/pkgs/main/win-64/repodata.json.bz2>
可能是源链接失效,可以搜新的链接再试,也有可能需要删掉condarc
文件中的- default
(我就是)