我有 PyQt5.QtWidgets 的问题

问题描述

我使用的是 python3 版本,但我无法弄清楚这个模块“QtWidgets”的错误 这是代码

from PyQt5 import QtWidgets

这里是输出

ImportError: DLL load Failed while importing QtWidgets: The specified module Could not be found.

解决方法

仍然没有合乎逻辑的答案,但我所做的是将 python 版本从 3.8 升级到 3.9,并且成功运行

编辑:问题出在QT的dll库中,python解释器找不到它们,我做了什么,我从“C:\Python38\Lib\site-packages\PyQt5\plugins\platforms”中复制了那些.dll库" 到我的可执行文件所在的文件夹,一切正常。