python Raspbian和PyQt5 ImportError:没有名为'PyQt5的模块,QtWebEngineWidgets'

0ve6wy6x  于 2023-04-28  发布在  Python
关注(0)|答案(4)|浏览(191)

长话短说,我已经通过apt-get在pi上安装了PyQt 5。除了QWebEngineView之外,一切似乎都很好。出于某种原因,我收到了这样的信息:
ImportError:没有名为'PyQt 5的模块。QtWebEngineWidgets'时,我试图导入它。
PyQt 5版本:5.8.2
有人知道吗?
提前感谢您的时间。
apt-cache search pyqt5返回

pyqt5-dev - Development files for PyQt5
pyqt5-dev-tools - Development tools for PyQt5
pyqt5-doc - Documentation for PyQt5
pyqt5-examples - Examples and demos for PyQt5
pyqt5.qsci-dev - Development files for Python Qscintilla2 (Qt5)
python-dbus.mainloop.pyqt5 - D-Bus Support for PyQt5 with Python
python-dbus.mainloop.pyqt5-dbg - D-Bus Support for PyQt5 (debug extensions for Python)
python-pyqt5 - Python bindings for Qt5
python-pyqt5-dbg - Python bindings for Qt5 (debug extensions)
python-pyqt5.enginio - Python 2 bindings for Enginio library
python-pyqt5.enginio-dbg - Python 2 bindings for Enginio library (debug extension)
python-pyqt5.qtmultimedia - Python bindings for Qt5's Multimedia module
python-pyqt5.qtmultimedia-dbg - Python bindings for Qt5's Multimedia module (debug extensions)
python-pyqt5.qtopengl - Python bindings for Qt5's OpenGL module
python-pyqt5.qtopengl-dbg - Python bindings for Qt5's OpenGL module (debug extension)
python-pyqt5.qtpositioning - Python bindings for QtPositioning module
python-pyqt5.qtpositioning-dbg - Python bindings for QtPositioning module (debug extension)
python-pyqt5.qtquick - Python bindings for QtQuick module
python-pyqt5.qtquick-dbg - Python bindings for QtQuick module (debug extension)
python-pyqt5.qtsensors - Python bindings for QtSensors module
python-pyqt5.qtsensors-dbg - Python bindings for QtSensors module (debug extension)
python-pyqt5.qtserialport - Python bindings for QtSerialPort module
python-pyqt5.qtserialport-dbg - Python bindings for QtSerialPort module (debug extension)
python-pyqt5.qtsql - Python bindings for Qt5's SQL module
python-pyqt5.qtsql-dbg - Python bindings for Qt5's SQL module (debug extension)
python-pyqt5.qtsvg - Python bindings for Qt5's SVG module
python-pyqt5.qtsvg-dbg - Python bindings for Qt5's SVG module (debug extension)
python-pyqt5.qtwebkit - Python bindings for Qt5's WebKit module
python-pyqt5.qtwebkit-dbg - Python bindings for Qt5's WebKit module (debug extensions)
python-pyqt5.qtwebsockets - Python bindings for Qt5's WebSockets module
python-pyqt5.qtwebsockets-dbg - Python bindings for Qt5's WebSockets module (debug extension)
python-pyqt5.qtx11extras - Python bindings for QtX11Extras module
python-pyqt5.qtx11extras-dbg - Python bindings for QtX11Extras module (debug extension)
python-pyqt5.qtxmlpatterns - Python bindings for Qt5's XmlPatterns module
python-pyqt5.qtxmlpatterns-dbg - Python bindings for Qt5's XmlPatterns module (debug extension)
python3-dbus.mainloop.pyqt5 - D-Bus Support for PyQt5 with Python 3
python3-dbus.mainloop.pyqt5-dbg - D-Bus Support for PyQt5 (debug extensions for Python 3)
python3-pyqt5 - Python 3 bindings for Qt5
python3-pyqt5-dbg - Python 3 bindings for Qt5 (debug extensions)
python3-pyqt5.enginio - Python 3 bindings for Enginio library
python3-pyqt5.enginio-dbg - Python 3 bindings for Enginio library (debug extension)
python3-pyqt5.qsci - Python 3 bindings for QScintilla 2 with Qt 5
python3-pyqt5.qsci-dbg - Python 3 bindings for QScintilla 2 (Qt 5 debug extensions)
python3-pyqt5.qtmultimedia - Python 3 bindings for Qt5's Multimedia module
python3-pyqt5.qtmultimedia-dbg - Python 3 bindings for Qt5's Multimedia module (debug extensions)
python3-pyqt5.qtopengl - Python 3 bindings for Qt5's OpenGL module
python3-pyqt5.qtopengl-dbg - Python 3 bindings for Qt5's OpenGL module (debug extension)
python3-pyqt5.qtpositioning - Python 3 bindings for QtPositioning module
python3-pyqt5.qtpositioning-dbg - Python 3 bindings for QtPositioning module (debug extension)
python3-pyqt5.qtquick - Python 3 bindings for QtQuick module
python3-pyqt5.qtquick-dbg - Python 3 bindings for QtQuick module (debug extension)
python3-pyqt5.qtsensors - Python 3 bindings for QtSensors module
python3-pyqt5.qtsensors-dbg - Python 3 bindings for QtSensors module (debug extension)
python3-pyqt5.qtserialport - Python 3 bindings for QtSerialPort module
python3-pyqt5.qtserialport-dbg - Python 3 bindings for QtSerialPort module (debug extension)
python3-pyqt5.qtsql - Python 3 bindings for Qt5's SQL module
python3-pyqt5.qtsql-dbg - Python 3 bindings for Qt5's SQL module (debug extension)
python3-pyqt5.qtsvg - Python 3 bindings for Qt5's SVG module
python3-pyqt5.qtsvg-dbg - Python 3 bindings for Qt5's SVG module (debug extension)
python3-pyqt5.qtwebkit - Python 3 bindings for Qt5's WebKit module
python3-pyqt5.qtwebkit-dbg - Python 3 bindings for Qt5's WebKit module (debug extensions)
python3-pyqt5.qtwebsockets - Python 3 bindings for Qt5's WebSockets module
python3-pyqt5.qtwebsockets-dbg - Python 3 bindings for Qt5's WebSockets module (debug extensions)
python3-pyqt5.qtx11extras - Python 3 bindings for QtX11Extras module
python3-pyqt5.qtx11extras-dbg - Python 3 bindings for QtX11Extras module (debug extension)
python3-pyqt5.qtxmlpatterns - Python 3 bindings for Qt5's XmlPatterns module
python3-pyqt5.qtxmlpatterns-dbg - Python 3 bindings for Qt5's XmlPatterns module (debug extension)
pyqt5 - Build of PyQt5 compiled for eglfs Qt5 and Python3 on Raspbian
hgtggwj0

hgtggwj01#

**注意:**QtWebEngineWidgets通常无法在Windows下使用v3之前的Python版本。5、编译器不兼容。

Source

pgvzfuti

pgvzfuti2#

问题是他们忘了编译qtwebkit和-engine。或者你自己下载并编译,或者你降级到更低的版本。对于Mac:pip 3 install PyQt 5 ==5。10(这是一个稳定的版本)。

weylhg0b

weylhg0b3#

QtWebEngine需要单独安装。

python -m pip install PyQtWebEngine

您可以在安装时将这一行更改为使用apt-get。
您可能需要根据代码导入模块和子模块。

from PyQt5 import QtWebEngineWidgets
from PyQt5.QtWebEngineWidgets import *

from PyQt5 import QtWidgets
from PyQt5.QtWidgets import *

您是否从第三方服务器安装自定义PyQt 5构建以使用优先级编解码器?

sz81bmfz

sz81bmfz4#

QtWebEngine基于Chromium,这是一个很大的工具包。
因此不适用于所有平台/不兼容。
也许降级到基于QtWebKit的是一个更可能的解决方案。

相关问题