树莓派:No module named ‘PyQt5.QtMultimedia‘

解决: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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值