使用清华镜像更新scikit-learn 从0.17到0.19

从网上下的程序,调用了sklearn.model_selection,结果module not found
查了一下我的版本
conda list
发现是1.17,这个版本没有这个module,需要更新。
使用conda update scikit-learn
报了一大堆错。
应该是连接外网的问题。然后找了一篇文章,使用清华镜像进行更新。

sklearn官网最新版本镜像在境外,通过吧我的源改成清华大学的镜像源。
cmd环境下输入:conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
conda update scikit-learn
进行上面的步骤之后,我发现scikit-learn还是没有更新成功,然后进行下面的操作。

下面是使用清华大学的镜像安装的报错信息:
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
ProxyError(MaxRetryError("HTTPSConnectionPool(host=‘mirrors.tuna.tsinghua.edu.cn’, port=443): Max retries exceeded with url: /anaconda/pkgs/free/win-64/repodata.json (Caused by ProxyError(‘Cannot connect to proxy.’,

在Anaconda中安装scikit-learn过程出现的错误,一开始我还以为是我在输链接的时候打错了,结果不是这里的问题。
后来我在自己电脑的C盘上C:\Users\lqk.condarc找到.condarc文件,打开时发现里面只有一行信息:
show_channel_urls: true
后来我就添加了
channels:

https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
show_channel_urls: true
然后就成功的更新了scikit-learn包。
不过有的电脑上的.condarc文件可能是
channels:

https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
defaults
show_channel_urls: true
可以尝试着把下面的-defaults一行删除,在进行更新。

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值