我正在尝试使用picamera模块在已安装有Raspbian 64位操作系统的Raspberry Pi B+上打开相机,但是出现了以下错误:
Traceback (most recent call last):
File "/home/pi/Documents/hydroponics/scripts/picamera_test.py", line 1, in <module>
from picamera import PiCamera
File "/home/pi/.local/lib/python3.9/site-packages/picamera/__init__.py", line 72, in <module>
from picamera.exc import (
File "/home/pi/.local/lib/python3.9/site-packages/picamera/exc.py", line 41, in <module>
import picamera.mmal as mmal
File "/home/pi/.local/lib/python3.9/site-packages/picamera/mmal.py", line 49, in <module>
_lib = ct.CDLL('libmmal.so')
File "/usr/lib/python3.9/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libmmal.so: cannot open shared object file: No such file or directory
摄像头已启用(我尝试使用OpenCV捕获摄像头并成功)。 我也尝试过
sudo rpi-update
,它显示我的固件已经是最新的。
我还尝试了sudo apt update
和sudo apt upgrade
,但它们都没有解决上述问题。
我还尝试了sudo ldconfig -p | grep mmal
,它输出: libmmal_vc_client.so (libc6) => /opt/vc/lib/libmmal_vc_client.so
libmmal_util.so (libc6) => /opt/vc/lib/libmmal_util.so
libmmal_core.so (libc6) => /opt/vc/lib/libmmal_core.so
libmmal_components.so (libc6) => /opt/vc/lib/libmmal_components.so
libmmal.so (libc6) => /opt/vc/lib/libmmal.so
有什么建议可以解决这个错误吗?谢谢!