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)

相关推荐
0和1的舞者3 小时前
网络通信的奥秘:HTTP详解 (七)
服务器·网络·网络协议·http·okhttp·软件工程·1024程序员节
huangdengji5 小时前
基于openresty反向代理、dns劫持、实现对http请求、响应内容抓包
网络协议·http·openresty
不懂音乐的欣赏者8 小时前
Windows 下 ROS/ROS2 开发环境最优解:WSL 比直接安装、虚拟机、双系统更优雅!
linux·windows·ubuntu·ros·wsl·ros2·双系统
神仙别闹9 小时前
基于C语言 HTTP 服务器客户端的实验
服务器·c语言·http
打不了嗝 ᥬ᭄11 小时前
【Linux】网络层协议
linux·网络·c++·网络协议·http
一叶飘零_sweeeet11 小时前
Java 项目 HTTP+WebSocket 统一权限控制实战
java·websocket·http·权限控制
进击的圆儿11 小时前
HTTP协议深度解析:从基础到性能优化
网络协议·http·性能优化
周杰伦fans1 天前
.NET Core WebAPI 中 HTTP 请求方法详解:从新手到精通
网络协议·http·.netcore
@大嘴巴子1 天前
零基础学习计算机网络编程----理解http协议
学习·计算机网络·http
利刃大大1 天前
【高并发服务器:HTTP应用】十五、HttpRequest请求模块 && HttpResponse响应模块设计
服务器·c++·http·项目