Default / 默认 · August 31, 2021

“解决ImportError

Table of Content

首先安装1)

    pip install PyQtWebEngine

2)

    pip install PyQt5==5.11.3

使用QtWebEngineWidgets替换__QtWebKitWidgets__

2In PyQt5 “QtWebKitWidgets” is Deprecated. I just replace this line

from PyQt5.*QtWebKitWidgets* import *QWebView*, *QWebPage*from PyQt5.*QtWebKit* import *QWebSettings*

With this code:

from PyQt5.QtWebEngineWidgets import QWebEngineView as QWebView,QWebEnginePage as QWebPagefrom PyQt5.QtWebEngineWidgets import QWebEngineSettings as QWebSettings
QtWebKitWidgets.QWebView()
替换为
QtWebEngineWidgets.QWebEngineView()
%d bloggers like this: