首页 > 解决方案 > ImportError: DLL load failed while importing QtWidgets: 操作成功完成

问题描述

我正在运行一个基本的 PyQt5 代码

import PyQt5.QtWidgets as qt
class MainWindow(qt.QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("Hello World!!")
        self.setLayout(qt.QVBoxLayout())
        self.show()
app=qt.QApplication([])
mw=MainWindow()
app.exec_()

错误显示为“ImportError: DLL load failed while importing QtWidgets: The operation completed successfully.”

我正在使用 Python 3.9.6 和最新的 PyQt5 版本 5.15.4

我也尝试了堆栈溢出中的所有可能解决方案

请有人帮忙

标签: pythonpython-3.xpyqt5importerror

解决方案


推荐阅读