waveform80 / picamera

A pure Python interface to the Raspberry Pi camera module
https://picamera.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.56k stars 358 forks source link

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

Open lazyboytql opened 4 months ago

lazyboytql commented 4 months ago

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

guoxiaolong5669 commented 3 months ago

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

Vaylordqt commented 3 months ago

did you resolve this issue ?

imbrianj commented 2 months ago

Are you running a 32 bit or 64 bit OS?

6by9 commented 2 months ago

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.