换源方法
1、打开配置文件
sudo gedit ~/.condarc
2、把下面内容复制到文件中,覆盖原来的内容
channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud//pytorch/ - defaults show_channel_urls: true channel_alias: http://mirrors.tuna.tsinghua.edu.cn/anaconda default_channels: - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: conda-forge: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud msys2: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud bioconda: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud menpo: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud ssl_verify: true
一些常用操作
恢复默认源:conda config --remove-key channels
删除旧镜像源:conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/
添加新镜像源:conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/
显示目前的源:conda config --show channels
参考博客
https://blog.csdn.net/weixin_40977054/article/details/115524523
https://blog.csdn.net/weixin_44706512/article/details/104652809
https://blog.csdn.net/weixin_39719427/article/details/116938432