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](https://blog.csdn.net/a578977626/article/details/135445412) \[2\] [『技术随手学』解决CondaHTTPError: HTTP 000 CONNECTION 问题](https://zhuanlan.zhihu.com/p/260034241)

相关推荐
ftpeak2 小时前
从零开始使用 axum-server 构建 HTTP/HTTPS 服务
网络·http·https·rust·web·web app
weixin_4569042714 小时前
使用HTTPS 服务在浏览器端使用摄像头的方式解析
网络协议·http·https
拷贝码农卡卡东1 天前
pre-commit run --all-files 报错:http.client.RemoteDisconnected
网络·网络协议·http
又菜又爱玩呜呜呜~1 天前
go使用反射获取http.Request参数到结构体
开发语言·http·golang
cellurw1 天前
Linux下C语言实现HTTP+SQLite3电子元器件查询系统
linux·c语言·http
希望20171 天前
Golang | http/server & Gin框架简述
http·golang·gin
全栈技术负责人1 天前
前端网络性能优化实践:从 HTTP 请求到 HTTPS 与 HTTP/2 升级
前端·网络·http
Whisper_Yu1 天前
计算机网络(一)基础概念
计算机网络·http·https·信息与通信
emojiwoo2 天前
HTTP 状态码背后的逻辑:从请求到响应的完整流程解析(含完整流程图)
网络·网络协议·http
娅娅梨2 天前
HarmonyOS-ArkUI Web控件基础铺垫7-HTTP SSL认证图解 及 Charles抓包原理 及您为什么配置对了也抓不到数据
http·华为·ssl·harmonyos