ImportError: No module named 'PyQt5.QtWebEngineWidgets'

I try to run a python script using PyQt5 QtWebEngineWidgets but it throws errors:

  from PyQt5.QtWebEngineWidgets import (
ImportError: No module named 'PyQt5.QtWebEngineWidgets'

I think there is a package missing but which one? python3-pyqt5.qtwebkit is installed.

How to get this working?


I'm not 100% certain that this addresses the OP's error message, but at least for Ubuntu 17.04 I have successfully run:

apt-get install python3-pyqt5.qtwebengine

This brings in loads of dependencies, including libqt5webenginecore5, libqt5webenginewidgets5, python3-pyqt5.qtwebchannel and python3-pyqt5.qtwebengine.

I do not know how this relates to @The Compiler's answer of QtWebEngine not being packaged for Ubuntu, but it worked for me without any compiling of Qt/PyQt.


I had the same issue, when trying to run Spyder for the first time. I'm using a Miniconda distribution on Mac. I had to install both so that I could lunch Spyder

pip install PyQtWebEngine
pip install PyQt5

I hope this help.