报错原因:
WebEngine和WebKit混合在一起使用
解决方法:
下面两种写法选其中一种写法。
WebEngine:
from PyQt5.QtWebEngineWidgets import QWebEnginePage
from PyQt5.QtWebEngineWidgets import QWebEngineView
WebKit:
from PyQt5.QtWebKitWidgets import QWebPage
from PyQt5.QtWebKitWidgets import QWebView
参考来自:
https://stackoverflow.com/questions/48848061/python-pyqt5-cannot-import-name-qwebview