将Anaconda设置为国内镜像源的方法

因为默认使用国外镜像源,下载速度相对较慢,为了节省时间提高效率,需要将源设置修改为国内镜像源,配置国内镜像源方法如下 。
1.打开的
如果不知道自己之前是否安装过多少镜像,可以用
conda config --show channels
显示镜像源,如果是新安装则默认使用国外镜像源,它会显示
channels:- defaults
如果想要删除重置,则执行

将Anaconda设置为国内镜像源的方法

文章插图
conda config --remove-key channels #删除所有的镜像源,恢复到默认orconda config --remove channels [urls] #删除指定的镜像源
2.在命令行下依次输入下面两行命令,配置国内镜像源:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --set show_channel_urls yes
3.再输入以下命令验证一下是不是配置成功
conda config --show channels
【将Anaconda设置为国内镜像源的方法】显示以下输出内容则设置成功
将Anaconda设置为国内镜像源的方法

文章插图
channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/- defaults
4.配置国内镜像源全部命令过程如下图所示
建议下面也全部添加,虽然有些可能用不到,但是实际包含比较冷门的包
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/conda config --set show_channel_urls yes
5.附,国内常用的镜像:
http://mirrors.aliyun.com/pypi/simple/ #阿里https://pypi.tuna.tsinghua.edu.cn/simple/ #清华http://pypi.douban.com/ #豆瓣http://pypi.mirrors.ustc.edu.cn/ #中国科学技术大学