picamera icon indicating copy to clipboard operation
picamera copied to clipboard

Error : OSError: libbcm_host.so: cannot open shared object file: No such file or directory

Open lazyboytql opened this issue 1 year ago • 4 comments

Currently, when I run the picamera program in the virtual environment (env), this error is displayed: Traceback (most recent call last): File "/home/linh/docker-python/camera.py", line 1, in import picamera File "/home/linh/myenv/lib/python3.11/site-packages/picamera/init.py", line 72, in from picamera.exc import ( File "/home/linh/myenv/lib/python3.11/site-packages/picamera/exc.py", line 41, in import picamera.mmal as mmal File "/home/linh/myenv/lib/python3.11/site-packages/picamera/mmal.py", line 47, in from .bcm_host import VCOS_UNSIGNED File "/home/linh/myenv/lib/python3.11/site-packages/picamera/bcm_host.py", line 47, in _lib = ct.CDLL('libbcm_host.so') File "/usr/lib/python3.11/ctypes/init.py", line 376, in init self._handle = _dlopen(self._name, mode) OSError: libbcm_host.so: cannot open shared object file: No such file or directory

In this virtual environment I have installed all the necessary libraries to run the program. I am using raspberry pi 4 Model B+ and Picamera V3 Please help me fix this error and get your response as soon as possible, thank you very much !! Error

lazyboytql avatar Feb 29 '24 16:02 lazyboytql

I have the same problem and do not know how to solve it

guoxiaolong5669 avatar Mar 21 '24 09:03 guoxiaolong5669

did you resolve this issue ?

Vaylordqt avatar Mar 22 '24 02:03 Vaylordqt

Are you running a 32 bit or 64 bit OS?

imbrianj avatar Apr 11 '24 17:04 imbrianj

Looking at the OP

I am using raspberry pi 4 Model B+ and Picamera V3

The v3 camera is ONLY supported by libcamera, not the legacy firmware camera stack. picamera is therefore incompatible with it as it is using the legacy stack. You need to use libcamera / rpicam-apps / picamera2.

If using a V1, V2, or HQ camera, then picamera can only work on the 32 bit OS, even if the SoC is capable of running a 64bit one.

The legacy stack is deprecated, and you are strongly advised to migrate to a libcamera based solution.

6by9 avatar Apr 15 '24 13:04 6by9