首先打开anaconda prompt,然后执行命令conda config --set show_channel_urls yes 创建出.condarc文件,文件路径在c:\User\username下。
然后记事本打开文件,将内容改为:
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
ssl_verify: true
保存即可
如果要安装pytorch,还需要加上
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
如果要换回默认源,直接删除channels即可,运行命令:
conda config --remove-key channels