我正在windows
系统和Pycharm
上执行代码。
我有一个错误:
* C:\ Users \ HP \ PycharmProjects \ untitled2 \ venv \ Scripts \ python.exe C:/Users/HP/PycharmProjects/untitled2/MyBrowser.py Traceback(最近一次调用最后一次): 文件“C:/Users/HP/PycharmProjects/untitled2/MyBrowser.py”,第5行,in 来自PyQt5.QtWebEngineView导入* ModuleNotFoundError:没有名为'PyQt5.QtWebEngineView'的模块*
如何解决此问题?我的代码:
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtWebEngineView import *
import sys
class MainWindow(QMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
self.setWindowTitle(" Shikhar ")
self.browser = QWebView()
self.browser.setUrl( QUrl("http://www.google.com") )
self.setCentralWidget(self.browser)
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()