文章目录

  • 背景
  • 错误提示
  • 解决方案

建议关注我的 微信公众号:破壳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: 找不到指定的程序。

解决方案

  1. 查看 C:\Users\用户名\anaconda3\envs\wechatbot\Lib\site-packages\win32 目录下是否存在 win32gui.pyd 文件

    如果没有即运行 pip install pywin32 进行安装。

  2. C:\Users\用户名\anaconda3\envs\wechatbot\Lib\site-packages\pywin32_system32 添加到系统环境变量。

注:
a. 用户名 替换为你自己的用户名;
b. 前半部分 C:\Users\用户名\anaconda3anaconda 的安装路径,替换为你自己的;
c. \envs\wechatbot 是我创建的新环境(wechatbot)的路径,替换为你自己的环境,如果没有创建则忽略,直接找到 \Lib\site-packages\win32 即可。

  1. 在原 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: 找不到指定的程序报错的解决方案相关推荐

  1. Python使用Pillow包报错 ImportError: DLL load failed while importing _imaging: 找不到指定的程序。

    最近使用Python调用Pillow时报错,代码就两行: from PIL import Imageprint("PyCharm") 报错如下: Traceback (most r ...

  2. import statsmodels.api as sm 时 ImportError: DLL load failed while importing _arpack: 找不到指定的程序。

    import statsmodels.api as sm 时 报错如下: 解决过程曲折,大致就是 scipy 版本与 statsmodels 的有些方法 不兼容,scipy==1.6.0后,问题解决了 ...

  3. Django终端运行报错:ImportError: DLL load failed while importing _sqlite3: 找不到指定的模块。

    在pycharm运行没问题,但是在终端cmd或Powershell就会出错,如下: Traceback (most recent call last):File ".\manage.py&q ...

  4. ImportError: DLL load failed while importing _multiarray_umath: 找不到指定的模块(pyinstaller打包的问题)

    本人环境配置: RTX3060 Win10 cuda11.1 Python3.8 Pytorch1.7.1 问题描述 本人需要将有导入torch包的python文件通过pyinstaller打包生成e ...

  5. 【问题记录】ImportError: DLL load failed while importing _imaging: 找不到指定的模块

    在 windows 上使用 matplotlib 包的时候报错如下: ImportError: DLL load failed while importing _imaging: 找不到指定的模块. ...

  6. [Win11] ImportError: DLL load failed while importing _multiarray_umath: 找不到指定的模块 Conda无法激活环境

    文章目录 1 报错 2 解决 参考 1 报错 Traceback (most recent call last):File "<stdin>", line 1, in ...

  7. 【BUG】DLL load failed while importing pyopenpose: 找不到指定的模块

    问题: ImportError: DLL load failed while importing pyopenpose: 找不到指定的模块. 解决方法: 1.把build\bin里面的全部dll,复制 ...

  8. Original error was: DLL load failed while importing _multiarray_umath: 找不到指定的模块

    Python运行异常 问题描述 During handling of the above exception, another exception occurred:Traceback (most r ...

  9. jupyter notebook出现DLL load failed while importing _multiarray_umath: 找不到指定的模块

    安装gpu版本的pytorch之后,在pycharm上测试没出现问题而在jupyter notebook却出现问题 问题描述: import torch E:\Miniconda3\envs\d2l\ ...

最新文章

  1. @Html.Partial,@Html.Action,@Html.RenderPartial,@Html.RenderAction
  2. 用store方法调列表界面的代码
  3. SVM熟练到精通1:初识SVM
  4. Linux df -h查看磁盘使用情况
  5. 信息学奥赛一本通(1083:计算星期几)
  6. oracle修改memory,修改memory——target的值
  7. HDU3782 xxx定律【数学计算+水题】
  8. Android开启/关闭飞行模式命令
  9. NumpyPandas内置函数实现分组
  10. jmeter 报405错误_jmeter压测报错问题汇总:
  11. Android 中AlarmManager升级4.2
  12. 工业互联网:制造业的二次升级
  13. aardio - 【开源软件】aardio文件加解密
  14. [HSI论文阅读] | HybridSN: Exploring 3-D–2-D CNN Feature Hierarchy for Hyperspectral Image Classification
  15. 用emWin的2D绘图函数画一个带圆形端点的环形进度条
  16. 英文论文画图常用软件
  17. NIST Cybersecurity White Paper 2021
  18. HTML+CSS大作业:餐饮美食网页设计与实现——下午茶甜点美食带psd(6页)
  19. 积极主动的态度到底有多重要?
  20. 视频直播点播平台EasyDSS如何通过接口调用实现截取视频的功能?

热门文章

  1. ROHM | 面向高端ADAS开发出业界超稳定运行的DC-DC转换器IC“BD9S402MUF-C”
  2. 一度智信:拼多多平台开网店怎么收费?
  3. 【若泽大数据001】Linux基础知识汇总
  4. 去掉goland中间的令人烦躁的竖线
  5. alv 导出料号缺少最后一位
  6. 163企业邮箱价格费用标准是多少?
  7. 导出iPhone应用crash日志步骤说明
  8. iphone导出视频出错(连接到系统上的设备没有发挥作用)
  9. Abaqus对复合材料进行建模的三种方式的对比
  10. c语言怎么打出花边图案,甄嬛舌尖各种版本苏牙咬人 连黄梅戏C语言都来了