anaconda下载catboost

一、出现的问题

首先在anaconda终端输入以下命令:

conda install catboost

 后来还是发生了报错:

Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url 
Elapsed: -

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.
ConnectTimeout(MaxRetryError("HTTPSConnectionPool(host='conda.anaconda.org', port=443): Max retries exceeded with url: /r/win-64/current_repodata.json (Caused by ConnectTimeoutError(, 'Connection to conda.anaconda.org timed out. (connect timeout=9.15)'))"))

 在Anaconda下准catboost备下载东西的时候,出现了这样的报错:

An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent......

二、解决问题

 查找了网上很多资料,可能是源的问题,就是默认下载东西的链接是国外的镜像,存在一些问题,因此将源改成国内的镜像即 可。

可以用清华大学提供的镜像

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

conda config --set show_channel_urls yes

在C:\Users\用户名 目录下找到并打开 .condarc 文件加上如下内容:

channels: 
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 
- defaults

show_channel_urls: yes

然后下载问题就可以解决。

你可能感兴趣的:(Python学习之路)