使用wxauto出现ImportError: DLL load failed while importing win32gui: 找不到指定的程序报错的解决方案
文章目录
- 背景
- 错误提示
- 解决方案
建议关注我的 微信公众号:破壳Ai,分享最佳学习路径、教程和资源。成长路上,我陪你。
背景
利用 wxauto 开发微信机器人,Pycharm 中运行程序时出错
错误提示
Traceback (most recent call last):File "D:\Project\wechatBot\test.py", line 2, in <module>from wxauto import WeChatFile "C:\Users\pokeu\anaconda3\envs\wechatbot\lib\site-packages\wxauto\__init__.py", line 2, in <module>from .wxauto import WxParam, WxUtils, WeChat, COPYDICTFile "C:\Users\pokeu\anaconda3\envs\wechatbot\lib\site-packages\wxauto\wxauto.py", line 10, in <module>import win32gui, win32con
ImportError: DLL load failed while importing win32gui: 找不到指定的程序。
解决方案
查看
C:\Users\用户名\anaconda3\envs\wechatbot\Lib\site-packages\win32
目录下是否存在win32gui.pyd
文件如果没有即运行
pip install pywin32
进行安装。将
C:\Users\用户名\anaconda3\envs\wechatbot\Lib\site-packages\pywin32_system32
添加到系统环境变量。
注:
a. 用户名
替换为你自己的用户名;
b. 前半部分 C:\Users\用户名\anaconda3
是 anaconda
的安装路径,替换为你自己的;
c. \envs\wechatbot
是我创建的新环境(wechatbot)的路径,替换为你自己的环境,如果没有创建则忽略,直接找到 \Lib\site-packages\win32
即可。
- 在原
import ...
前先导入以下库:import pywintypes
,如:
import pywintypes
#import pythoncom # Uncomment this if some other DLL load will fail
from wxauto import WeChat
import time, random
现在再去运行程序,应该就没有报错了。
如果解决了您的问题,建议关注下我的 微信公众号:破壳Ai,多谢支持!
使用wxauto出现ImportError: DLL load failed while importing win32gui: 找不到指定的程序报错的解决方案相关推荐
- Python使用Pillow包报错 ImportError: DLL load failed while importing _imaging: 找不到指定的程序。
最近使用Python调用Pillow时报错,代码就两行: from PIL import Imageprint("PyCharm") 报错如下: Traceback (most r ...
- import statsmodels.api as sm 时 ImportError: DLL load failed while importing _arpack: 找不到指定的程序。
import statsmodels.api as sm 时 报错如下: 解决过程曲折,大致就是 scipy 版本与 statsmodels 的有些方法 不兼容,scipy==1.6.0后,问题解决了 ...
- Django终端运行报错:ImportError: DLL load failed while importing _sqlite3: 找不到指定的模块。
在pycharm运行没问题,但是在终端cmd或Powershell就会出错,如下: Traceback (most recent call last):File ".\manage.py&q ...
- ImportError: DLL load failed while importing _multiarray_umath: 找不到指定的模块(pyinstaller打包的问题)
本人环境配置: RTX3060 Win10 cuda11.1 Python3.8 Pytorch1.7.1 问题描述 本人需要将有导入torch包的python文件通过pyinstaller打包生成e ...
- 【问题记录】ImportError: DLL load failed while importing _imaging: 找不到指定的模块
在 windows 上使用 matplotlib 包的时候报错如下: ImportError: DLL load failed while importing _imaging: 找不到指定的模块. ...
- [Win11] ImportError: DLL load failed while importing _multiarray_umath: 找不到指定的模块 Conda无法激活环境
文章目录 1 报错 2 解决 参考 1 报错 Traceback (most recent call last):File "<stdin>", line 1, in ...
- 【BUG】DLL load failed while importing pyopenpose: 找不到指定的模块
问题: ImportError: DLL load failed while importing pyopenpose: 找不到指定的模块. 解决方法: 1.把build\bin里面的全部dll,复制 ...
- Original error was: DLL load failed while importing _multiarray_umath: 找不到指定的模块
Python运行异常 问题描述 During handling of the above exception, another exception occurred:Traceback (most r ...
- jupyter notebook出现DLL load failed while importing _multiarray_umath: 找不到指定的模块
安装gpu版本的pytorch之后,在pycharm上测试没出现问题而在jupyter notebook却出现问题 问题描述: import torch E:\Miniconda3\envs\d2l\ ...
最新文章
- @Html.Partial,@Html.Action,@Html.RenderPartial,@Html.RenderAction
- 用store方法调列表界面的代码
- SVM熟练到精通1:初识SVM
- Linux df -h查看磁盘使用情况
- 信息学奥赛一本通(1083:计算星期几)
- oracle修改memory,修改memory——target的值
- HDU3782 xxx定律【数学计算+水题】
- Android开启/关闭飞行模式命令
- NumpyPandas内置函数实现分组
- jmeter 报405错误_jmeter压测报错问题汇总:
- Android 中AlarmManager升级4.2
- 工业互联网:制造业的二次升级
- aardio - 【开源软件】aardio文件加解密
- [HSI论文阅读] | HybridSN: Exploring 3-D–2-D CNN Feature Hierarchy for Hyperspectral Image Classification
- 用emWin的2D绘图函数画一个带圆形端点的环形进度条
- 英文论文画图常用软件
- NIST Cybersecurity White Paper 2021
- HTML+CSS大作业:餐饮美食网页设计与实现——下午茶甜点美食带psd(6页)
- 积极主动的态度到底有多重要?
- 视频直播点播平台EasyDSS如何通过接口调用实现截取视频的功能?