Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError #175

Open
Hubert2208 opened this issue Dec 6, 2024 · 6 comments
Open

ModuleNotFoundError #175

Hubert2208 opened this issue Dec 6, 2024 · 6 comments

Comments

@Hubert2208
Copy link

Version of home_assistant

Homeassistant 2024.12.0

Version of the custom_component

2.1.24

Describe the bug

The Component isn't starting

Debug log

Logger: homeassistant.setup
Quelle: setup.py:334
Erstmals aufgetreten: 5. Dezember 2024 um 19:17:43 (1 Vorkommnisse)
Zuletzt protokolliert: 5. Dezember 2024 um 19:17:43

Setup failed for custom integration 'dwd_weather': Unable to import component: No module named 'simple_dwd_weatherforecast'
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 1034, in async_get_component
self._component_future.result()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1014, in async_get_component
comp = await self.hass.async_add_import_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self._get_component, True
^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/loader.py", line 1074, 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.13/importlib/init.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 1022, in exec_module
File "", line 488, in _call_with_frames_removed
File "/config/custom_components/dwd_weather/init.py", line 13, in
from simple_dwd_weatherforecast import dwdforecast
ModuleNotFoundError: No module named 'simple_dwd_weatherforecast'

@FL550
Copy link
Owner

FL550 commented Dec 6, 2024

I guess you run HA in a container?

@Hubert2208
Copy link
Author

jep. Running in a container on kubernetes

@bunnu
Copy link

bunnu commented Dec 7, 2024

I'm having the same issue, running on Kubernetes.
Not sure if this is dwd_weather releated, because two other components installed via HACS are having the same issue (Unable to import component: No module named <module>).

@Hubert2208
Copy link
Author

I found now a solution for the problem.
The Folder /config/deps/lib/python3.12/ have to be moved to /config/deps/lib/python3.13/
The new Version auf HA has bumped Python to Version 3.13
I also had an old folder /config/deps/lib/python3.11/. This one i deleted.

@bunnu
Copy link

bunnu commented Dec 7, 2024

Then it's the same issue as last month: home-assistant/core#127966 and https://community.home-assistant.io/t/wth-is-going-on-with-docker-container-installs-and-third-party-integrations-that-need-python-modules/806430

Thanks for the hint. I didn't find this thread and issue yesterday.
I can confirm the workaround creating .dockerenv in / solved the issue.

@FL550 FL550 pinned this issue Dec 22, 2024
@FL550 FL550 changed the title Compatibility with HA 2024.12.0 ModuleNotFoundError Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants