ImportError: Error loading shared library _LR: No such file or directory

Hi,

For some reason, my brand new (but hours of work) Home Assistant deployment on Raspberry Pi 4 using OS installl method (recommended) now fails.

I am unable to get past “Loading data” in the web browser, and I figured out how to get ahold of the core logs, which I paste below. It seems there is a problem with numpy, but I can’t figure out how to fix it…

Any suggestion would be welcome!

Log:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/stream/core.py:15
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 12:53:03 AM (7 occurrences)
Last logged: 1:09:33 AM

[548012963200] Error handling message: Unknown error (unknown_error) Vincent Rioux from 192.168.150.160 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48)
[547995407440] Error handling message: Unknown error (unknown_error) Vincent Rioux from fe80::dfb1:ac1e:a8:a74f (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48)
[548078995824] Error handling message: Unknown error (unknown_error) Vincent Rioux from fe80::dfb1:ac1e:a8:a74f (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48)
[547997935904] Error handling message: Unknown error (unknown_error) Vincent Rioux from fe80::dfb1:ac1e:a8:a74f (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48)
[548013489936] Error handling message: Unknown error (unknown_error) Vincent Rioux from fe80::dfb1:ac1e:a8:a74f (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48)
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/numpy/core/__init__.py", line 23, in <module>
    from . import multiarray
  File "/usr/local/lib/python3.10/site-packages/numpy/core/multiarray.py", line 10, in <module>
    from . import overrides
  File "/usr/local/lib/python3.10/site-packages/numpy/core/overrides.py", line 6, in <module>
    from numpy.core._multiarray_umath import (
ImportError: Error loading shared library _LR: No such file or directory (needed by /usr/local/lib/python3.10/site-packages/numpy/core/../../numpy.libs/libopenblas_armv8p-r0-8b2c479e.3.20.so)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 351, in handle_get_services
    descriptions = await async_get_all_descriptions(hass)
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 585, in async_get_all_descriptions
    contents = await hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 553, in _load_services_files
    return [_load_services_file(hass, integration) for integration in integrations]
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 553, in <listcomp>
    return [_load_services_file(hass, integration) for integration in integrations]
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 535, in _load_services_file
    _SERVICES_SCHEMA(load_yaml(str(integration.file_path / "services.yaml"))),
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
    cval = cvalue(key_path, value)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 636, in validate_sequence
    cval = validate(index_path, value)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 353, in _exec
    v = func(path, v)
  File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 140, in validate_supported_feature
    return _validate_option_or_feature(supported_feature, "supported feature")
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 115, in _validate_option_or_feature
    base_components = _base_components()
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 68, in _base_components
    from homeassistant.components import (
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 30, in <module>
    from homeassistant.components.stream import (
  File "/usr/src/homeassistant/homeassistant/components/stream/__init__.py", line 61, in <module>
    from .core import (
  File "/usr/src/homeassistant/homeassistant/components/stream/core.py", line 15, in <module>
    import numpy as np
  File "/usr/local/lib/python3.10/site-packages/numpy/__init__.py", line 140, in <module>
    from . import core
  File "/usr/local/lib/python3.10/site-packages/numpy/core/__init__.py", line 49, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.10 from "/usr/local/bin/python3"
  * The NumPy version is: "1.23.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: Error loading shared library _LR: No such file or directory (needed by /usr/local/lib/python3.10/site-packages/numpy/core/../../numpy.libs/libopenblas_armv8p-r0-8b2c479e.3.20.so)
1 Like

I have exactly the same issue. I have had this issue on HA OS prior to v10.

The prior fix I used was this:

  • SSH into HA
  • Log into the Homeassistant container with “docker exec -it homeassistant bash”
  • copy python3.10 into python3.9 directories with “cp /usr/local/lib/python3.10 /usr/local/lib/python3.9 -R”

Will let you know if I win with v10.

I reinstalled everything from scratch… Hoping it was something I did. Now, a few days later, and reconfiguring everything from scratch, I got the same error! :frowning:

Now, when trying to log into the web interface, I get stuck on loading data.

Also, full logs… After full reinstall from scratch…

Logs here

I tried that, and saw your post. I hoped… But no. It seems to be a different cause…

Downgraded to 2023.1.6 and now it is no longer a problem.

1 Like

Yes. No luck on v10. Pls ignore my prior “fix”

Am having exact same issue, i too installed on a new board per recommend instructions.
What I noticed is, if I restarted raspberry Pi this happens immediately even after setting up everything from scratch.

Exactly same error down to the crack.

No luck identifying the root cause here…

Quick update: I rebooted my Raspberry Pi to install HACS (had not even started installing it), and got back in the same problem, even without upgrading or doing anything… So whatever happens is happening even with no update…

Another update. I lost everything again. This bug is really bad. Makes me want to abandon HA. :frowning:

Now, ha core is in a boot loop…

2023-05-02 23:47:21.541 ERROR (MainThread) [homeassistant.setup] Error during setup of component stream
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 256, in _async_setup_component
    result = await task
  File "/usr/src/homeassistant/homeassistant/components/stream/__init__.py", line 224, in async_setup
    from .recorder import async_setup_recorder
  File "/usr/src/homeassistant/homeassistant/components/stream/recorder.py", line 9, in <module>
    import av
  File "/usr/local/lib/python3.10/site-packages/av/__init__.py", line 20, in <module>
    from av import logging
ImportError: Error loading shared library libXfixes-d5f50c54.so.3.1.0: Exec format error (needed by /usr/local/lib/python3.10/site-packages/av/.                                                                                                               ./ha_av.libs/libva-x11-9a51a992.so.2.1400.0)

For me, I’ve downgraded to 2023.4 and disabled updates. So far so good.