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

相关推荐
半支烟隐 pzishuo7 小时前
HTTP Live Streaming(HLS)直播技术分析与实现
网络·网络协议·http
Alexon Xu9 小时前
Java中的HTTP组件全方位对比
http
Yan_chen66610 小时前
HTTP和HTTPS 完整指南
网络协议·web安全·http·网络安全·https
蜡台10 小时前
Flutter HTTP 请求完整详解
网络协议·flutter·http·dart
AI人工智能+电脑小能手1 天前
【大白话说Java面试题 第216题】【10_网络协议篇】第7题:HTTP 协议和 HTTPS 协议的区别
java·http·网络安全·https·ssl/tls
想学好C++的oMen1 天前
应用层协议http
网络·网络协议·http
烛衔溟1 天前
HarmonyOS 网络连接 —— HTTP 请求、Axios 与 Socket 通信
http·华为·harmonyos
kaixin_啊啊1 天前
群晖部署Vaultwarden:HTTPS访问、自动填充与密码迁移
网络协议·http·https
weixin_727535622 天前
HTTP 八股文:从三次握手到浏览器渲染的硬核拆解
网络·网络协议·http
久久学姐2 天前
Python开发爬虫的常用技术架构
爬虫·python·http·框架·数据存储