close

[Solved] Cannot import QtWebKitWidgets in PyQt5

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Cannot import QtWebKitWidgets in PyQt5 in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Cannot import QtWebKitWidgets in PyQt5 Error Occurs?

Today I get the following error Cannot import QtWebKitWidgets in PyQt5 in python.

How To Solve Cannot import QtWebKitWidgets in PyQt5 Error ?

  1. How To Solve Cannot import QtWebKitWidgets in PyQt5 Error ?

    To Solve Cannot import QtWebKitWidgets in PyQt5 Error I was trying to run qutebrowser and it had the same error, the answer is simple, the packages changed

  2. Cannot import QtWebKitWidgets in PyQt5

    To Solve Cannot import QtWebKitWidgets in PyQt5 Error I was trying to run qutebrowser and it had the same error, the answer is simple, the packages changed

Solution 1

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

Solution 2


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

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read