import sys
from PyQt5 import QtWidgets
def main():
app = QtWidgets.QApplication([])
window = QtWidgets.QMainWindow()
label = QtWidgets.QLabel('\tHello World!')
window.setCentralWidget(label)
window.show()
app.exec_()
if __name__ == '__main__':
main()
尝试通过cmd“pip install pyqt5”和“pip install pyqt5-tools”安装pyqt5后执行
此处附有显示错误的图片