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 问题

相关推荐
Goodbye14 小时前
大模型无状态架构:从 HTTP 协议到 Harness AI 工程的深度解析
http
霜落长河7 天前
抛弃TCP改用UDP,HTTP3怎么了?
http
之歆8 天前
现代 HTTP 客户端深度解析:Fetch 与 Axios
chrome·网络协议·http
程序员mine8 天前
HTTPS-TLS加密与证书完全指南(下)
网络协议·http·https
SomeOtherTime8 天前
http协议处理播放video/mp4视频
http
llz_1129 天前
web-第五次课后作业
前端·后端·http
曾阿伦9 天前
netcat / ncat / socat 用法详解与示例
linux·http·信息与通信
cyforkk9 天前
破除网络协议迷雾:TCP、TLS 与 HTTP 的“连环套”逻辑
网络协议·tcp/ip·http
VidDown9 天前
视频协议传输全解析:从 HTTP/HTTPS 到 HLS/DASH 的完整旅程
javascript·网络·http·https·编辑器·音视频·视频编解码
Patrick_Wilson10 天前
Cookie 作用域避坑:父域泄漏、同名优先级与多环境隔离
前端·http·浏览器