Python报错 ImportError: DLL load failed while importing win32api: %1 不是有效的 Win32 应用程序 的解决方法
今天在用jupyter notebook 的时候发生了kernel error,点开之后提示了以下报错信息
Traceback (most recent call last):
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\tornado\web.py", line 1704, in _execute
result = await result
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "E:\Anaconda3\lib\site-packages\notebook\services\sessions\handlers.py", line 69, in post
model = yield maybe_future(
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 762, in run
value = future.result()
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "E:\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 88, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 762, in run
value = future.result()
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "E:\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 100, in start_kernel_for_session
kernel_id = yield maybe_future(
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 762, in run
value = future.result()
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 234, in wrapper
yielded = ctx_run(next, result)
File "E:\Anaconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\jupyter_client\multikernelmanager.py", line 185, in start_kernel
km.start_kernel(**kwargs)
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\jupyter_client\manager.py", line 309, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(**kw)
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\jupyter_client\manager.py", line 256, in pre_start_kernel
self.write_connection_file()
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\jupyter_client\connect.py", line 468, in write_connection_file
self.connection_file, cfg = write_connection_file(self.connection_file,
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\jupyter_client\connect.py", line 138, in write_connection_file
with secure_write(fname) as f:
File "E:\Anaconda3\lib\contextlib.py", line 113, in __enter__
return next(self.gen)
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\jupyter_core\paths.py", line 435, in secure_write
win32_restrict_file_to_user(fname)
File "C:\Users\boqia\AppData\Roaming\Python\Python38\site-packages\jupyter_core\paths.py", line 361, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed while importing win32api: %1 不是有效的 Win32 应用程序。
主要先看后两行报错信息,我们知道jupyter notebook再import win32api的时候报错了
这可能是由于python版本是64位的,但电脑中已经存在了32位的pywin32所导致的
我们在命令行中运行以下代码来卸载pywin32
pip uninstall pywin32
由于可能电脑中存在多个版本的pywin32,所以卸载完成后在运行以下代码查看时候还有没卸载的pywin32
pip show pywin32
如果返回了如下结果,则说明电脑中仍然存在pywin32
C:\Users\boqia>pip show pywin32
Name: pywin32
Version: 227
Summary: Python for Window Extensions
Home-page: https://github.com/mhammond/pywin32
Author: Mark Hammond (et al)
Author-email: mhammond@skippinet.com.au
License: PSF
Location: e:\anaconda3\lib\site-packages
Requires:
Required-by: jupyter-core, xlwings, pypiwin32
这时候我们只需要在执行一次卸载命令就行了
pip uninstall pywin32
再彻底卸载完pywin32之后,我们在使用以下命令,安装所兼容的pywin32
pip install pywin32
安装完成后,应该就不会再报错了.
Python报错 ImportError: DLL load failed while importing win32api: %1 不是有效的 Win32 应用程序 的解决方法的更多相关文章
- python——报错ImportError:DLL load failed with error code -1073741795的解决方式
python中导入一个包,import cv2总是报错'ImportError:DLL load failed with error code -1073741795',报错形式: 网上找了好久的解决 ...
- 转载:Win7系统 利用 pycharm导入Tensorflow失败,出现报错——ImportError:DLL load failed with error code -1073741795的解决方式
转载自:https://blog.csdn.net/shen123me/article/details/80621103 下面的报错信息困扰了一天,网上的各种方法也都试过了,还是失败,最后自己瞎试,把 ...
- ImportError: DLL load failed while importing win32api: 找不到指定的模块。
这个是用pip install pywin32安装报的一个错误 据说直接使用pip install pypiwin32安装就不会有报错 但是遇到错误还是要尝试解决一下的 pip install pyw ...
- 解决:ImportError: DLL load failed while importing _sqlite3: 找不到指定的模块。
Django框架学习第一步,创建一个Django工程. 本次采用的是创建虚拟环境来创建Django工程.本地解释器采用anaconda ,内置Python3.8 在pycharm中报错: 内容如下:I ...
- conda使用报错:ImportError:DLL load failed
conda安装python环境经常报: ImportError:DLL load failed 将环境变量加入path可以解决: D:\program\anaconda D:\program\anac ...
- import cx_Oracle报错,提示importError: DLL load failed: 不是有效的Win32程序。
问题说明1:WIN32,python是2.7版本,本地oracle client是32位的.import cx_Oracle报错,提示importError: DLL load failed: 该模块 ...
- ImportError: DLL load failed: 找不到指定的模块;ImportError: numpy.core.multiarray failed to import 报错解决
python程序运行出错,出错的两行主要信息如下: ImportError: DLL load failed: 找不到指定的模块 ImportError: numpy.core.multiarray ...
- 终于解决了python 3.x import cv2 “ImportError: DLL load failed: 找不到指定的模块” 及“pycharm关于cv2没有代码提示”的问题
终于解决了python 3.x import cv2 “ImportError: DLL load failed: 找不到指定的模块” 及“pycharm关于cv2没有代码提示”的问题 参考 :h ...
- python ImportError: DLL load failed: %1 不是有效的 Win32 应用程序
导入的时候报出了 ImportError 在windows上安装python 的模块后,导入模块时报 python ImportError: DLL load failed: %1 不是有效的 Win ...
随机推荐
- PAT B1013 数素数
输入样例: 5 27 输出样例: 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 解题思路: 从2开始 ...
- 谈谈Spring中都用到了哪些设计模式?
谈谈Spring中都用到了哪些设计模式? JDK 中用到了那些设计模式?Spring 中用到了那些设计模式?这两个问题,在面试中比较常见.我在网上搜索了一下关于 Spring 中设计模式的讲解几乎都是 ...
- Blazor组件自做四 : 使用JS隔离封装signature_pad签名组件
运行截图 演示地址 响应式演示 感谢szimek写的棒棒的signature_pad.js项目, 来源: https://github.com/szimek/signature_pad 正式开始 1. ...
- crm多对多
多对多要使用service.Associate传入两表的id和中间表的 service.Associate("invoice", entityReferenceInvoice.Id ...
- 三个步骤,从零开始快速部署LoRaServer
2021年11月29日,ITU(国际电信联盟)标准化部门正式批准了LoRa联盟立项的"ITU-T Y.4480 Low power protocolfor wide area wireles ...
- 第十三届蓝桥杯省赛C/C++ B组
@(第十三届蓝桥杯省赛C/C++B组) A顺子日期 答案是1478 B顺子日期 答案14(如果012算的话) C刷题统计 数据范围1e18,所以不能直接暴力,先取余,再暴力剩下的 #include&l ...
- Mysql学习day1
安装了Mysql以及SQLyog,将SQLyog和数据库做了连接. 学习了基础数据类型以及命令行语句 1 alter table `student` rename as `stu``lesson` 2 ...
- 2021.08.05 P2168 荷马史诗(哈夫曼树模板)
2021.08.05 P2168 荷马史诗(哈夫曼树模板) [P2168 NOI2015] 荷马史诗 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 重点: 1.k叉哈夫曼树如果子结 ...
- 手写一个bind
1 Function.prototype.bind1 = function(){ 2 // 将类数组转化成数组 3 let arr = Array.prototype.slice.call(argum ...
- 解决Mapper.xml文件中sql标签第一个字段报错
在文件标头的http后边补上www 下边代码仅第4行有变动 原文件: <?xml version="1.0" encoding="UTF-8"?> ...