UOS安装QWebEngineWidgets

Python3调用QWebEngineWidgets报错

PyQt5调用QWebEngineWidgets报错,没有该模块

> python3
Python 3.7.3 (default, Apr  2 2021, 05:20:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt5.QtWebEngineWidgets import QWebEngineView
Traceback (most recent call last):
  File "", line 1, in <module>
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'

解决办法,用命令安装QWebEngineWidgets

sudo apt install python3-pyqt5.qtwebengine

C++调用QWebEngineWidgets报错

终端输入sudo apt install libqt5webengine命令安装对应的库,输入命令按两下tab键可补全相关的库,选择对应的库安装即可

lzc@uniontech ~> sudo apt install libqt5webengine
libqt5webengine5         libqt5webengine-data   
libqt5webenginecore5     libqt5webenginewidgets5

省事点就直接执行以下命令

sudo apt install qtwebengine5-*
sudo apt install libqt5webengine5

你可能感兴趣的:(UOS,PyQt5,linux)