Conda使用时CondaHTTPError: HTTP 000 CONNECTION FAILED错误解决

1、错误描述

最近使用conda create环境时遇见下面错误,Ubuntu和Windows都会遇到:

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.

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

'https://repo.anaconda.com/pkgs/main/linux-64'

2、解决方法

(1)首先检查防火墙是否关闭

这是很坑的,我折腾了好久发现防火墙没关闭!!!

(2)推荐修改镜像源

Windowns直接搜索.condarc进行编辑,Ubuntu则使用下面命令编辑:

vi ~/.condarc

直接把下面内容复制粘贴:

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/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
show_channel_urls: true
ssl_verify: false

但是windows下有时候还是有问题,尝试将https改为http就没问题了。

(3)不行了换个网络或者换手机热点试试哈哈哈

你可能感兴趣的:(python,ubuntu,linux,运维,python,Conda)