ImportError: DLL load failed while importing _ssl: 找不到指定的模块的解决方法

ImportError: DLL load failed while importing _ssl: 找不到指定的模块的解决方法

现象

在命令行中,可以正常导入_ssl模块,如下:

bash 复制代码
Python 3.9.0 (default, Nov 15 2020, 08:30:55) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import _ssl
>>>

但是在Jupyter notebook中无法导入,报错:ImportError: DLL load failed while importing _ssl: 找不到指定的模块 如下:

bash 复制代码
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[2], line 1
----> 1 import _ssl

ImportError: DLL load failed while importing _ssl: 找不到指定的模块。

解决办法

配置系统环境变量,在path中新增如下内容:

新增之后,重启Jupyter Notebok即可,再次导入便可解决问题了。

注意:如果创建了多个虚拟环境,找到对应的虚拟环境目录进行替换。

相关推荐
code monkey.27 分钟前
【Linux之旅】Linux 应用层自定义协议与序列化:从粘包问题到网络计算器
linux·网络·c++
2401_8924233629 分钟前
OSPF笔记
网络·智能路由器
草莓熊Lotso29 分钟前
【Linux网络】深入理解 HTTP 协议(二):从协议格式到手写工业级 HTTP 服务器
linux·运维·服务器·网络·c++·http
The Straggling Crow7 小时前
Network
网络
yyuuuzz7 小时前
独立站的技术基础与常见运维问题
大数据·运维·服务器·网络·数据库·aws
Oll Correct10 小时前
实验二十九:TCP的运输连接管理
网络·笔记
Cheng小攸12 小时前
综合实验2
网络·windows
Soari13 小时前
SSH 主机密钥冲突
运维·网络·ssh
且听风吟_xincell14 小时前
用 TypeScript 从零写一个 TCP 聊天室(上)—— 网络编程入门实战
网络·tcp/ip·typescript
万法若空15 小时前
Libevent C语言开发完全教程:从入门到实战
c语言·网络