使用清华镜像更新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一行删除,在进行更新。

作者:无风起浪*
来源:CSDN
原文:https://blog.csdn.net/qq_37749442/article/details/85204507
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/qq_17854471/article/details/89381456