-
Notifications
You must be signed in to change notification settings - Fork 6
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
Error occurred loading flow for integration openplantbook: No module named 'openplantbook_sdk' #32
Comments
I ended up installing it via pip and it seems to work now, but this might still be an issue for other users? |
It's in the manifest, so it should be installed automatically. @slaxor505: Have you changed anything in your end?
|
The library is in PyPi. I have not changed anything since the release. It would be interesting to see HASS startup log when it is supposed to attempt and install the library automatically using the manifest. I'm wondering @mots if you have some old Python version because the library minimum is Python 3.9, however since you managed to install it via pip then it might be something else preventing its installation during HASS start up. Would you be able to send a log from HASS? |
I have the same error. HASS is deployed as container -
|
Hi Max. Can you provide HASS startup log please?
…On Fri, 18 Oct 2024, 06:31 Max, ***@***.***> wrote:
I have the same error. HASS is deployed as container -
home-assistant:2024.10.2
Upgraded the extension via HACS.
Logger: homeassistant.setup
Source: setup.py:334
First occurred: 13:48:24 (1 occurrences)
Last logged: 13:48:24
Setup failed for custom integration 'openplantbook': Unable to import component: No module named 'openplantbook_sdk'
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/openplantbook/__init__.py", line 11, in <module>
from openplantbook_sdk import MissingClientIdOrSecret, OpenPlantBookApi
ModuleNotFoundError: No module named 'openplantbook_sdk'
—
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADGJ4FDDUQOUMIV3UMOXN6TZ4AF7ZAVCNFSM6AAAAABQB5ZHQKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRQGM3DOMZTHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
hi @slaxor505 , below are the logs that I get after the container restart. (I've also tried to reinstall the extension for good measure) |
Hi @maxim-mityutko. I'm a bit puzzled here as your startup log is very short. I don't see HASS is setting up components. What log level is set? For example my log much more talkative. Can you increase log level maybe? See attached. If I remove the library from the python then I will see the following message where HASS attempts to install it. I'm wondering if it is some setting in HASS or not generic HASS container.
|
Hi all, I was trying to replicate the issue but was unable to do so. I removed and downgraded to OPB 1.2 then I reset Docker container (hass config is persistent). Then I started brand the new container with OPB 1.2. I see that hass installs previous OPB integration library from Olen. Checked that integration works fine. Then upgraded to OPB 1.3, on startup HASS installed opb_sdk on startup with no issues. Then again I checked that integration works fine. I'm quite puzzled why the issue occurs and need your help to troubleshoot it. |
Thanks for investigating @slaxor505, my logs were indeed set to
logs-from-home-assistant-in-home-assistant-5d86c4b867-dslsw.log |
And with
So I see that
|
Didn't HA recently do some "smart" changes to the installation order of modules? I don't have the docs in front of me here, but I seem to remember there was something with some of the other integrations as well, that needed a minor change to ensure the modules are installed in time. |
I could not find anything like this in docs. https://developers.home-assistant.io/docs/creating_integration_manifest#requirements I assume you are talking about other components in "dependencies". But it is not about python libraries but HASS components that the component is dependent on. https://developers.home-assistant.io/docs/creating_integration_manifest#dependencies I'm wondering if it is specific to architecture. Can @maxim-mityutko let me know if you run it on Raspberry PI? I have not tested this on Arm architecture I can try to do so. |
Thanks for the details @maxim-mityutko I dag deeper and I see that in my docker container config/deps directory is empty and all the python libs are installed in /usr/local/lib/python3.12/site-packages including openplantbook_sdk. I have question, do you have any other python libs in "deps" directory too or it is only openplantbook_sdk in there? If it is the only library then does the directory actually visible to python interpreter? E.g. in %PATH% variable. |
But pretty much all libraries except for And the
|
Seems like a related thread: home-assistant/core#127966 |
It's running on x86 node |
Don't know where and how the HACS dependencies were installed originally (prior to 2024.10). Which in turn uses The problem however is that Hence the path does not end up in PATH. |
Good catch and it does seem that it is getting a known problem. I'm just curious how it works in my case. All libraries in my docker container have been installed in "site-packages" but not in "deps" which is empty. I also use x86 genuine HASS image. I'm pondering what it depends on and what could be a work around. One obvious is to issue "pip install openplantbook-sdk" within container but not really user friendly one. |
What do you see in the logs, is the
Installing manually can work as a temporaru workaround, but won't persist after container is recreated. So not really an option in the long run. Do you by any chance have |
I reset the container and this is what I got from the startup logs.
I don't have --target parameter as you can see. And I do have .dockerenv in the root drwxr-xr-x 91 root root 4.0K Oct 23 20:28 . |
Ok, then I have a good idea of what's going on. The packages are installed with There is a bit of conditional logic there that appends
It is called from here with kwargs, one of them is
As you can see And the
I run my container in Kubernetes, i don't have this file, hence after all the chain of logic is applied I get the |
Nice debugging. I think this should be raised with the main HA repo. But why does it not affect other integrations you have installed? |
I don't have a lot of custom integrations that come from HACS, I assume that coincidentally the dependencies for those are available as part of normal HASS distribution. I agree, the issue is not with this extension. I'll post my finding in the HA core thread. |
It seems that it was fixed in the latest HASS release. @maxim-mityutko does it work for you now? |
@slaxor505 , nope same error on |
The workaround from parallel thread: |
I've decided to go with dummy |
Should this library ship with the component? I installed using HACS in a docker container.
The text was updated successfully, but these errors were encountered: