hassio-addons / addon-appdaemon

AppDaemon4 - Home Assistant Community Add-ons
https://addons.community
MIT License
151 stars 47 forks source link

OpenCV library fails to load in AppDaemon #214

Closed LeoI5 closed 1 year ago

LeoI5 commented 1 year ago

Problem/Motivation

I tried to use OpenCV inside AppDaemon and received error in log: ImportError: Error relocating /usr/lib/python3.10/site-packages/cv2/cv2.abi3.so: cblas_dgemm: symbol not found

Expected behavior

OpenCV functions work in AppDaemon addon

Actual behavior

AppDaemon stopped load app and remove app from load

Steps to reproduce

Add param to AppDaemon config: python_packages: - opencv-python-headless

Add to AppDaemon app: import cv2

Proposed changes

No

What type of installation are you running?

AppDaemon 0.9.3 Home Assistant supervised 2022.10.5 Supervisor 2022.10.0 Frontend 20221010.0 - latest and AppDaemon 0.9.3 Home Assistant HAOS 2022.10.5 Supervisor 2022.10.0 Operating System 9.3 Frontend 20221010.0 - latest

frenck commented 1 year ago

Seems like you need to install lapack or blas system packages to get all dependencies required.

Alternatively (and also faster in startup), you could install the opencv python Alpine system package directly.

https://pkgs.alpinelinux.org/package/v3.16/community/armv7/py3-opencv

../Frenck

LeoI5 commented 1 year ago

system_packages:

resolved the problem.

Thanks! Leonid