天天看点

Conda常用命令环境换源Windows配置

环境

创建环境 conda create --name py27 python=2.7
查询现有环境 conda info -e
删除环境 conda remove -n py27 --all
切换环境 conda acticate py27

换源

配置国内镜像地址

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.ustc.edu.cn/anaconda/pkgs/free/
           

检查镜像是否配置成功

conda config --set show_channel_urls yes
conda config --show channels
           

Windows配置

powershell初始化conda

conda init powershell
           

常见问题

powershell:无法加载文件ps1,因为在此系统中禁止执行脚本

set-executionpolicy remotesigned