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)

相关推荐
伊玛目的门徒6 小时前
HTTP SSE 流式响应处理:调用腾讯 智能应用开发平台ADP智能体的 API
python·网络协议·http·腾讯智能体·adp·智能应用开发平台
黑贝是条狗8 小时前
用mormot2 orm模式搭建一个http服务验证设备的注册信息
网络·网络协议·http
脑壳疼___10 小时前
手写海康OpenApi签名规范,实现手动调用api(sdk:artemis-http-client)
网络·网络协议·http
while(1){yan}11 小时前
HTTP的数据报格式
java·开发语言·网络·网络协议·http·青少年编程·面试
爆肝疯学大模型11 小时前
http转https,免费快速申请证书并实现nginx配置
nginx·http·https
元气满满-樱12 小时前
Http概述
网络·网络协议·http
油丶酸萝卜别吃12 小时前
如何使用http-server --cors启动页面?
网络·网络协议·http
喵爸的小作坊1 天前
StreamPanel:一个让 SSE 调试不再痛苦的 Chrome 插件
前端·后端·http
李少兄1 天前
从零开始全面掌握 HTTPS
网络协议·http·https
是垚不是土1 天前
基于Blackbox Exporter的网络服务黑盒监控体系实践
网络·数据库·安全·http·微服务·prometheus