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

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

相关推荐
火车叼位3 小时前
Windows 双网关自动切换:Node.js + 计划任务实现旁路由优先
网络协议·程序员
小张小张爱学习5 小时前
网络编程高频面试题
网络
Shingmc35 小时前
【Linux】数据链路层
linux·服务器·网络
A hao5 小时前
IP65防护等级对户外LED显示屏意味着什么
网络
无心水5 小时前
【Hermes:进阶调优与性能优化】45、性能调优:降低延迟与 token 消耗的 7 个技巧 —— 让 Hermes 智能体跑得更快、花得更少
网络·性能优化·mcp协议·openclaw·养龙虾·hermes·honcho
小贾要学习6 小时前
【Linux】Linux高性能IO多路复用:epoll全方位详解(从原理到实战)
linux·服务器·网络
编程大师哥6 小时前
高效服务器管理工具 Xshell 8 下载安装配置设置详细教程
网络
想唱rap8 小时前
五种IO模型和非阻塞IO
linux·运维·服务器·网络·数据库·tcp/ip
Bruce_Liuxiaowei8 小时前
AI攻防时间差:当漏洞发现速度碾压修复速度— 聚焦技术核心
网络·人工智能·网络安全·ai·系统安全
方安乐8 小时前
交换机的自学机制
运维·服务器·网络