Requirements of custom integrations not available

I’m having a weird issue with my HACS-installed integrations after upgrading HACS to the latest version (v2.0.1): When upgrading or installing custom integrations, HACS/HA somehow fails to install necessary requirements as needed for the integration. For example, in the case of the ramses_cc integration, after adding the repository and restarting HA I get:

2024-10-29 22:09:39.673 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'ramses_cc': Unable to import component: No module named 'ramses_rf'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in async_get_component
    self._component_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1007, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/ramses_cc/__init__.py", line 26, in <module>
    from ramses_rf.entity_base import Entity as RamsesRFEntity
ModuleNotFoundError: No module named 'ramses_rf'

… even though the integration lists ramses_rf as a requirement (which IIUC means it should get installed automatically): ramses_cc/custom_components/ramses_cc/manifest.json at 8e4deba67c8e56de788d67668fc20d76f2b84667 · zxdavb/ramses_cc · GitHub

No matter how many times I try to remove the custom integration, re-start HA in between, etc, the dependency doesn’t get installed.

I had a very similar issue with the Passive BLE Monitor failing to install aioblescan, which again is listed as a requirement: ble_monitor/custom_components/ble_monitor/manifest.json at eb88dee978410038ea2b7cd7cbd6a1f006038167 · custom-components/ble_monitor · GitHub

I’m running HA 2024.10.4 in a container, using podman.

2 Likes

If I fully remove the integration and re-install it + restart HA, I see the ramses_rf dependency getting installed in $HA/deps. So the dependency does seem to get installed, it just doesn’t get picked up…

I am having the same problem with a different integration from HACS. The requirements are in /deps, but I still get module not found.

I’m running 2024.10.2 in a container

Were you able to figure this out?

I did not. I did hover hack my custom components to at least get my instance working again:

❯ head custom_components/ramses_cc/__init__.py
"""Support for Honeywell's RAMSES-II RF protocol, as used by CH/DHW & HVAC.

Requires a Honeywell HGI80 (or compatible) gateway.
"""

from __future__ import annotations

# HACK
import sys
sys.path.insert(0, "/config/deps")

Depends on the container filesystem layout, of course.

Hi,

I have exactly the same problem, with no “clean” solution.

The only thing I found on github is to install the missing modules this way:

pip install --target /config/deps/lib/python3.12/site-packages --upgrade --no-deps  pronotepy==2.14.1