I recently bought a Raspberry Pi 3b+ and Camera module v3. After days of troubleshooting, I got the camera to spit out images on the libcamera
CLI. But, I can't create a picamera.PiCamera
object in Python. Here's my error:
Python 3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from picamera import PiCamera
>>> camera = PiCamera()
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 456, in _init_camera
self._camera = mo.MMALCamera()
File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 2279, in __init__
super(MMALCamera, self).__init__()
File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 631, in __init__
mmal_check(
File "/usr/lib/python3/dist-packages/picamera/exc.py", line 184, in mmal_check
raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to create MMAL component b'vc.ril.camera': Out of memory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 431, in __init__
self._init_camera(camera_num, stereo_mode, stereo_decimate)
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 459, in _init_camera
raise PiCameraError(
picamera.exc.PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.
Using libcamera
, I don't get any errors. But, when I try creating a PiCamera
object, it fails, giving the above error. Please help!
Here's my specs:
- Raspberry pi 3b+
- Raspberry Camera Module 3