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

问题描述

在Anaconda下准备下载东西的时候,出现了这样的报错:
在这里插入图片描述

Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/r/noarch/repodata.json.bz2>
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.

If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.

SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/r/noarch/repodata.json.bz2 (Caused by SSLError(SSLError("bad handshake: SysCallError(10054, \'WSAECONNRESET\')")))'))

解决方法

解法一

配置清华大学的镜像

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
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/pkgs/free/
conda config --set show_channel_urls yes

检查Anaconda的config:查看channel个数以及格式

conda config --show

可以使用 下面命令换回默认源

conda config --remove-key channels

我上面这种方式是没有解决问题的!


解法二

进入c盘/用户/(用户名)/.condarc文件
在这里插入图片描述
把以下这段代码复制到这个.condarc文件中:

channels:
  - defaults
show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

保存再试一试就可以了!!!

已标记关键词 清除标记
# 我想安装 pycurl 库一直报ssl的错 **安装其他库也报这个错 我python 和 anacoda 卸载重装还是这样** ![图片说明](https://img-ask.csdn.net/upload/201912/29/1577603682_113807.png) ![图片说明](https://img-ask.csdn.net/upload/201912/29/1577603787_388466.png) **网上查到说添加环境变量 添加了但还是不行** anacoda 安装文件夹是anacode (新建文件夹的时候打错了) Python 3.7.6 windows 10 系统 大佬们知道什么原因吗? ``` 错误文本: pip install pycurl WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Requirement already satisfied: pycurl in d:\anacode\lib\site-packages (7.43.0.3) WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping C:\Users\Enz>conda install scrapy Collecting package metadata (current_repodata.json): failed CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json> 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. If your current network has https://www.anaconda.com blocked, please file a support request with your network engineering team. SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/main/win-64/current_repodata.json (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))')) ```
©️2020 CSDN 皮肤主题: 点我我会动 设计师:上身试试 返回首页