我已经尝试了许多教程和安装以使用带有 Python 的 rapsberry 4 picamera 我正在使用 Picamera 库,每次我使用这个简单的脚本或任何 picamera 脚本来尝试相机时,我都会收到以下错误消息:
mmal: mmal_component_create_core: could not find component 'vc.camera_info'
Traceback (most recent call last):
File "/home/pi/Desktop/ex.py", line 6, in <module>
camera = PiCamera()
File "/home/pi/.virtualenvs/cv450/lib/python3.9/site-packages/picamera/camera.py", line 367, in __init__
with mo.MMALCameraInfo() as camera_info:
File "/home/pi/.virtualenvs/cv450/lib/python3.9/site-packages/picamera/mmalobj.py", line 2346, in __init__
super(MMALCameraInfo, self).__init__()
File "/home/pi/.virtualenvs/cv450/lib/python3.9/site-packages/picamera/mmalobj.py", line 631, in __init__
mmal_check(
File "/home/pi/.virtualenvs/cv450/lib/python3.9/site-packages/picamera/exc.py", line 184, in mmal_check
raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to create MMAL component b'vc.camera_info': Function not implemented
我使用的代码是:
from time import sleep
from picamera import PiCamera
camera = PiCamera()
camera.resolution = (1024, 768)
camera.start_preview()
sleep(2)
camera.capture('foo.jpg')
谢谢您的帮助