解决:How can I add a missing PyQt5 modules on Raspberry Pi
If you installed the Raspbian pyqt5-dev and pyqt5-dev-tools packages, this will only provide the core PyQt5 modules like QtCore, QtGui, QtWidgets, etc. For other modules like QtMultimedia, you must install separate packages.
If you go to the Raspbian Connect Package List, and look in the Python Packages section, you will find the following extra packages:
python3-pyqt5.qsci
python3-pyqt5.qtmultimedia
python3-pyqt5.qtopengl
python3-pyqt5.qtpositioning
python3-pyqt5.qtquick
python3-pyqt5.qtsensors
python3-pyqt5.qtserialport
python3-pyqt5.qtsql
python3-pyqt5.qtsvg
python3-pyqt5.qtwebchannel
python3-pyqt5.qtwebkit
python3-pyqt5.qtwebsockets
python3-pyqt5.qtx11extras
python3-pyqt5.qtxmlpatterns
So just use apt-get to install whatever else you need.
命令行安装相应模块即可:
sudo apt-get install python3-pyqt5.qtmultimedia
若播放视频 positionChanged() 只返回0,可能是缺少相应解码器,比如H264