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

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

相关推荐
scofield_gyb1 分钟前
Cmd命令大全(万字详细版)
网络
程序猿编码42 分钟前
隐匿注入型ELF加壳器:原理、设计与实现深度解析(C/C++ 代码实现)
c语言·网络·c++·elf·代码注入
东北甜妹1 小时前
playbook
linux·服务器·网络
oi..2 小时前
Flag入门—Flag在返回包中
网络·笔记·测试工具·安全·网络安全
阿豪学编程3 小时前
【网络】五种IO模型
网络
bu_shuo3 小时前
IP相关知识
网络·网络协议·tcp/ip
深蓝轨迹3 小时前
TCP/IP 网络模型面试核心考点总结02(基础篇)
网络·tcp/ip·面试
不一样的故事1263 小时前
软件测试在未来10年
大数据·网络·人工智能·安全
头疼的程序员3 小时前
计算机网络:自顶向下方法(第七版)第六章 学习分享(三)
网络·学习·计算机网络