Cannot import QtWebKitWidgets in PyQt5 Cannot import QtWebKitWidgets in PyQt5 python python

Cannot import QtWebKitWidgets in PyQt5


QtWebKit got deprecated upstream in Qt 5.5 and removed in 5.6.

You may want to switch to PyQt5.QtWebEngineWidgets :

This supercedes the QtWebKit module and provides better and up-to-date support for HTML, CSS and JavaScript features


I was trying to run qutebrowser and it had the same error, the answer is simple, the packages changed.You have two solutions:

1)

pip install PyQtWebEngine

2)

pip install PyQt5==5.11.3

Hope this helps any future problems


In PyQt5 "QtWebKitWidgets" is Deprecated. I just replace this line

from PyQt5.QtWebKitWidgets import QWebView, QWebPagefrom PyQt5.QtWebKit import QWebSettings

With this code:

from PyQt5.QtWebEngineWidgets import QWebEngineView as QWebView,QWebEnginePage as QWebPagefrom PyQt5.QtWebEngineWidgets import QWebEngineSettings as QWebSettings