core: Opencv integration library fails to load after python 3.10 update

The problem

opencv library is failing to load with error message: No OpenCV library found! Install or compile for your system following instructions here: http://opencv.org/releases.html

Other custom components based on opencv are broken with the same requirements:

"requirements": ["numpy==1.23.0", "opencv-python-headless==4.6.0.66"]

What version of Home Assistant Core has the issue?

2022.7.0

What was the last working version of Home Assistant Core?

2022.6.7

What type of installation are you running?

Home Assistant Container

Integration causing the issue

OpenCV

Link to integration documentation on our website

https://www.home-assistant.io/integrations/opencv/

Diagnostics information

Version core-2022.7.0
Installation Type Home Assistant Container
Development false
Supervisor false
Docker true
User root
Virtual Environment false
Python Version 3.10.5
Operating System Family Linux
Operating System Version 5.15.0-40-generic
CPU Architecture x86_64
Timezone America/New_York
Configuration Directory /config

Example YAML snippet

No response

Anything in the logs that might be useful for us?

...

  import cv2
  File "/usr/local/lib/python3.10/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/usr/local/lib/python3.10/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: Error relocating /usr/local/lib/python3.10/site-packages/cv2/cv2.abi3.so: cblas_dgemm: symbol not found

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 16 (1 by maintainers)

Most upvoted comments

I simply used “requirements”: [“numpy”, “opencv-python-headless==4.7.0.72”] Open CV use numpy as dependences normally it should not be needed to install it, anyhow… I´ve also see Frank is working on it in the log of this component.

I found the solution there is to change on the manifest.json “numpy”, “opencv-python-headless==4.7.0.72” this will install correctly openCV

The error remains:

Logger: homeassistant.components.opencv.image_processing
Source: components/opencv/image_processing.py:105
Integration: opencv (documentation, issues)
First occurred: 21 de diciembre de 2022, 20:29:04 (1 occurrences)
Last logged: 21 de diciembre de 2022, 20:29:04

No OpenCV library found! Install or compile for your system following instructions here: http://opencv.org/releases.html

The problem remains in september version…

fortunately I was able to replace opencv with pillow for my application, maybe someone else here will have the same option