由于Anaconda默认使用国外镜像源,下载速度相对较慢,需要将设置修改为国内镜像源。
首先,打开命令行,输入conda config --set show_channel_urls yes,创建Anaconda配置文件.condarc。注意:使用Anaconda prompt (Anaconda3)或者Anaconda PowerShell prompt (Anaconda3),防止安装Anaconda时未将Anaconda添加到环境变量导致识别不了conda命令。
其次,运行conda clean -i 清除索引缓存,保证用的是镜像网站提供的索引。
然后,运行conda info可以查看Anaconda配置信息。
配置国内镜像源方法:
-
显示镜像源
conda config --show channels
-
添加新镜像源
conda config --add channels [urls…] -
删除镜像源
conda config --remove-key channels 删除所有的镜像源,恢复到默认
conda config --remove channels [urls] 删除指定的镜像源 -
设置搜索时显示通道地址
conda config --set show_channels_urls yes -
国内常用源镜像地址:
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:https://mirrors.aliyun.com/pypi/simple/
中国科技大学: https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:https://pypi.hustunique.com/
山东理工大学:https://pypi.sdutlinux.org/
豆瓣:https://pypi.douban.com/simple/
-
conda 安装指定的源
conda install -c urls lib_name
conda 更新第三方库
conda update [name]



