Anaconda修改国内镜像源

35 篇文章 4 订阅
26 篇文章 0 订阅

anaconda 安装完成后,国内的网络连接Anaconda的官方源,速度基本为0,大部分时间是连接不上的。国内清华大学有对应的镜像源,可以更改为对应的源,可以通过更换原解决

首先在终端(Terminal)运行下面的命令生成 anaconda的 .condarc配置文件:

conda config

使用下面命令查看 .condarc 中的源

conda config --show channels

windows下

1 添加清华源

打开anaconda prompt  ,在命令行中直接使用以下命令:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/

# 设置搜索时显示通道地址
conda config --set show_channel_urls yes

Linux下

将以上配置文件写在 ~/.condarc 中 
vim ~/.condarc

若安装了 sublime  的也可在终端使用  :subl ~/.condarc

channels:
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
  - https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - defaults
show_channel_urls: true

也可以把 anaconda 仓(https://repo.continuum.io/)的添加进去:

这是在anaconda安装 tensorflow1.4.1 的时候遇到的问题,把这个 anaconda 仓添加进去问题就解决了

channels:
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
  - https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://repo.continuum.io/pkgs/main
  - defaults
show_channel_urls: true

若源不生效,试着把.condarc文件中的 - defaults那行去掉,就不会出现这个问题了

 

 

Reference:

anaconda conda 换源

国内源停止 Anaconda 镜像服务后,我们该何去何从

Anaconda 清华源即将恢复!

清华大学开源软件镜像站

 

 

 

 

 

 

  • 20
    点赞
  • 80
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值