WSL中遇到CondaHTTPError: HTTP 000 CONNECTION FAILED for url解决方法

文章目录

遇到问题

之前用WSL使用conda都是正常的,今天用的时候遇到CondaSSLError: Encountered an SSL error. Most likely a certificate verification issue.

cpp 复制代码
(base) lishizheng@DESKTOP-8SJ6087:~$ conda update -n base -c defaults conda
Collecting package metadata (current_repodata.json): failed
CondaSSLError: Encountered an SSL error. Most likely a certificate verification issue.
Exception: HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/main/linux-64/current_repodata.json (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))

按照网上的教程操作了一遍,比如conda换源,更新conda conda update conda都是显示SSLError,最终想要重装annaconda,重装的时候遇到CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/current_repodata.json>

cpp 复制代码
conda create --name test python=3.8
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-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.
'https//mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64'

然后参考这篇文章『技术随手学』解决CondaHTTPError: HTTP 000 CONNECTION 问题, 发现下面的评论解决了我的问题。

解决方法

输入exit退出wsl,然后在windows系统下输入wsl --shutdown关闭wsl,之后再重启wsl,如下所示:

cpp 复制代码
(base) xxx@DESKTOP-8SJ6087:/mnt/d/lishizheng$ exit
logout
(base) PS D:\xxx> wsl --shutdown
(base) PS D:\xxx> wsl

后面的conda create --name test python=3.8便可以正常运行。

参考

1 关于conda ssl失效问题 报CondaSSLError: Encountered an SSL error. Most likely a certificate verification

2 『技术随手学』解决CondaHTTPError: HTTP 000 CONNECTION 问题

相关推荐
战南诚14 小时前
HTTP 与 HTTPS 的区别:从原理到实战详解
网络协议·http·https
风停了,叶落了16 小时前
2026年5月28日笔记
http
mCell16 小时前
别急着骂运营商,你家路由器里可能藏着一台 PCDN 盒子
前端·http·cdn
Seven9718 小时前
别只会说 HTTPS 更安全:一文吃透加密、证书与 TLS 握手
tcp/ip·http
艾莉丝努力练剑19 小时前
【Linux网络】传输层协议TCP(六)补充 - 面试题:HTTP 获取网页的完整过程
linux·运维·网络·tcp/ip·计算机网络·http·udp
越甲八千19 小时前
本地验证http服务器拉取文件
服务器·网络协议·http
郑洁文2 天前
基于Python的HTTP服务漏洞信息收集工具设计与实现
开发语言·python·http
草莓熊Lotso2 天前
【Linux网络】深入理解 HTTP 协议(一):从基础概念到 URL 编码解码
linux·网络·c++·网络协议·http·软件工程
SilentSamsara2 天前
HTTP 客户端实战:httpx/重试/限速/连接池/中间件设计
开发语言·网络·python·http·青少年编程·中间件·httpx
草莓熊Lotso2 天前
【Linux网络】深入理解 HTTP 协议(二):从协议格式到手写工业级 HTTP 服务器
linux·运维·服务器·网络·c++·http