conda env list:查看当前虚拟环境
conda create -n env_name:创建虚拟环境,建议使用
conda create -n py39 python=3.9 (flask Django):创建指定版本的指定模块的虚拟环境,比较耗时,不建议使用
conda activate env_name:激活虚拟环境
conda deactivate:退出虚拟环境
conda env export > environment.yml:导出环境配置
conda env create -f environment.yml:创建一样的环境
conda remove -n env_name –all:删除虚拟环境
conda list:列举当前环境下所有的包
which -a pip:查看pip处于哪个环境,如果不在当前虚拟环境,可以使用conda install pip 来安装当前环境的pip
conda config –remove-key channels:恢复默认源
conda config --show-sources:查看源
配置外部(清华)源:
conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config –set show_channel_urls yes
安装软件包出现RemoveError: ‘requests’ is a dependency of conda and cannot be removed from
conda’s operating environment.
使用命令:
conda update conda
不行之后用 conda update –force conda,之后再重新安装