解决 No module named 'PyQt5.QtWebEngineWidgets'

环境:

python 3.6.5
pyqt5

出错提示:

No module named 'PyQt5.QtWebEngineWidgets'

原因:

原文链接:https://www.riverbankcomputing.com/software/pyqt/download5
关键句:

Note that for v5.11 and later the 32-bit Windows wheels do not contain
the WebEngine modules.

翻译:请注意,对于v5.11及更高版本,32位Windows轮盘不包含WebEngine模块。

解决:

  • 【方法一】 指定安装5.10.1版本的pyqt5
    pip install pyqt5==5.10.1

  • 【方法二】 单独安装WebEngine,安装命令为:
    pip install PyQtWebEngine

你可能感兴趣的:(python)