请教各位大师: 在运行这个代码时总是报“进程已结束,退出代码为 -1073740791 (0xC0000409)”的错误,怀疑是QtWebEngine这个包安装的有问题,在网上没有看到类似情况的,被这个问题困扰了好几天了,请问各位大师这是什么原因导致的啊?
问题相关代码:
# -*- coding: utf-8 -*-
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtWebEngineWidgets import *
import sys
class MainWindow(QMainWindow):
def __init__(self ):
super(QMainWindow, self).__init__()
self.setWindowTitle('QWebView打开网页例子')
self.setGeometry(5, 30, 1355, 730)
self.browser = QWebEngineView()
#1 加载html代码
self.browser = QWebEngineView()
self.browser.setHtml('''
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h1>Hello PyQt5</h1>
<h1>Hello PyQt5</h1>
<h1>hello PyQt5</h1>
<h1>hello PyQt5</h1>
<h1>hello PyQt5</h1>
<h1>Hello PyQt5</h1>
</body>
</html>
'''
)
self.setCentralWidget(self.browser)
if __name__ == '__main__':
app = QApplication(sys.argv)
win = MainWindow()
win.show()
sys.exit(app.exec_())
运行结果及报错内容:
E:\pycharm\python程序\venv\Scripts\python.exe C:/Users/29362/Desktop/qt05_webview03.py
进程已结束,退出代码为 -1073740791 (0xC0000409)