Anaconda配置说明

基本指令

查看已有的虚拟环境

1
conda env list

退出当前虚拟环境

1
conda deactivate

创建虚拟环境

1
conda create -n <env_name> python=x.x

删除虚拟环境

1
2
conda remove -n <env_name> --all
conda remove --name <env_name> --all

查看当前使用源,添加指定源,删除指定源

1
2
3
conda config --show-sources
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

requirement.txt的生成与执行

1
2
pip install pipreqs
pipreqs ./

当项目所在文件夹中已有requirement.txt时,即可更新已经存在的requirement.txt文件了

1
pipreqs --force ./

若编码错误

1
pipreqs ./ --encoding=utf-8