Cannot open shared object file

Im getting this error when running

from picamera2.devices import Hailo

how to fix this

from picamera2.devices import Hailo
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python3.9/dist-packages/picamera2/devices/init.py”, line 3, in
from .hailo import Hailo
File “/usr/local/lib/python3.9/dist-packages/picamera2/devices/hailo/init.py”, line 1, in
from .hailo import Hailo
File “/usr/local/lib/python3.9/dist-packages/picamera2/devices/hailo/hailo.py”, line 5, in
from hailo_platform import HEF, FormatType, HailoSchedulingAlgorithm, VDevice
File “/usr/local/lib/python3.9/dist-packages/hailo_platform/init.py”, line 17, in
import hailo_platform.pyhailort._pyhailort as _pyhailort
ImportError: libhailort.so.4.19.0: cannot open shared object file: No such file or directory

Hey @SAN ,

First, make sure the Hailo SDK is actually installed. The library should be in a folder like /usr/local/lib or /usr/lib.

If the SDK is installed but Python still can’t find it, you’ll need to tell your system where to look. You can do this by adding the library path:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/hailo/lib

Want this to stick around after you restart your system? Just add that same line to your ~/.bashrc or ~/.profile file.

If you’re seeing a version mismatch (like you have version 4.18.0 but it wants 4.19.0), you can create a quick link between them:

sudo ln -s /path/to/hailo/libhailort.so.4.18.0 /path/to/hailo/libhailort.so.4.19.0

Just in case, you might want to check the file permissions too:

sudo chmod 755 /path/to/hailo/libhailort.so.*

If none of that works, you might need to reinstall the Hailo SDK to get the right library version.