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即可,再次导入便可解决问题了。

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

相关推荐
init_236120 小时前
【BGP入门专题-4】bgp路由属性2
网络
jenchoi41320 小时前
【2025-12-01】软件供应链安全日报:最新漏洞预警与投毒预警情报汇总
网络·安全·web安全·网络安全·npm
温启志c#20 小时前
【无标题极简版的 TCP 服务端和客户端实现,保留核心功能,去掉复杂封装,适合快速测试:】
运维·服务器·网络
Evan芙21 小时前
用fping编写脚本扫描10.0.0.0/24网段在线主机
linux·运维·网络·excel
故事挺秃然21 小时前
Python异步(Asyncio)(一)
服务器·网络·python
小毛驴85021 小时前
nrm test 所有源超时解决办法
linux·服务器·网络
qq_4798754321 小时前
Linux 网络实验(3)
linux·运维·网络
誰能久伴不乏21 小时前
为什么 TCP 服务端重启会出现 “Address already in use”问题解析
linux·服务器·c语言·网络·c++·tcp/ip
apihz1 天前
批量获取3位未注册短域名免费API接口每日更新
android·服务器·网络·网络协议·tcp/ip
Ares-Wang1 天前
Windows 系统下,Microsoft Loopback Adapter(微软环回适配器)
网络