Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x PyQt5导入错误:DLL加载失败_Python 3.x_Dll_Pyqt5_Importerror - Fatal编程技术网

Python 3.x PyQt5导入错误:DLL加载失败

Python 3.x PyQt5导入错误:DLL加载失败,python-3.x,dll,pyqt5,importerror,Python 3.x,Dll,Pyqt5,Importerror,我可能什么都试过了,但根本不起作用。 这是我的代码: import sys from pprint import pprint from PyQt5.QtWidgets import (QtWidgets, QPushButton, QLineEdit, QApplication) class MyWindow(QWidget): def __init__(self): super().__init__() self.btn = QPushButton(

我可能什么都试过了,但根本不起作用。 这是我的代码:

import sys
from pprint import pprint
from PyQt5.QtWidgets import (QtWidgets, QPushButton, QLineEdit, QApplication)

class MyWindow(QWidget):
    def __init__(self):
        super().__init__()
        self.btn = QPushButton('Open', self)
        self.btn.move(0, 20)
        self.btn.clicked.connect(self.showDialog)

        self.text_name = QLineEdit(self)
        self.text_name.move(100,22)
        self.text_name.setPlaceholderText("Enter your name:")

        self.setGeometry(300, 300, 290, 140)
        self.setWindowTitle("Input dialog example")

    def showDialog(self):
        text, result = QInputDialog.getText(self, 'Input Dialog', 'Enter your name:')
        if result == True:
            self.text_name.setText(str(text))

if __name__ == '__main__':
    app = QApplication(sys.argv)
    pprint("input parameters = " + str(sys.argv))
    my_window = MyWindow()
    my_window.show()
    sys.exit(app.exec_())
这就是错误:

我卸载并安装了Python3.7,更新了pip,已经卸载并安装了两次PyQt5。我已多次重新启动计算机,但仍然找不到解决方案。
请随时问我任何可以帮助您解决问题的问题。

将代码和错误消息以文本形式插入,而不是以屏幕截图形式插入。这里有多种答案:包括一些您没有提到的尝试,我以前尝试过,但没有一个成功。您是否在虚拟环境中?您是否验证了在正确的文件夹中有
Python3.dll
?您是否尝试降级PyQt的版本?
C:\Users\Alex\AppData\Local\Programs\Python\Python37
python3.dll在此文件夹中。我没有虚拟环境,也没有尝试降级pyQt的版本