I am trying to open camera with the picamera module in my Raspberry pi B+ with has Raspbian 64 bit OS installed in it. I get this error:
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
The camera is enabled (I tried to capture the camera with opencv and it worked).
I tried sudo rpi-update
as well and it says that my firmware is already up to date.
Tried sudo apt update
and sudo apt upgrade
but none of them solve the above issue.
I tried sudo ldconfig -p | grep mmal
as well and it outputs:
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
Any suggestions on what I can do to solve this error? Thanks!
I just found out that picamera is still not supported for Raspbian 64 bit OS.
https://github.com/raspberrypi/firmware/issues/1558#issuecomment-983483179
So we could probably use libcamera (didn't try it yet) or opencv (tried and works fine)