make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.42k stars 544 forks source link

tuya_local unable to import tinytuya after HASS update 2024.11.0 #2478

Closed mark-harmison closed 2 weeks ago

mark-harmison commented 2 weeks ago

Description

I updated HA Core to 2024.11.0 and now tuya_local is failing to load with the following error in the log:

Setup failed for custom integration 'tuya_local': Unable to import component: No module named 'tinytuya'

This was working just prior to the core update.

I'm still a little new to HA but plenty of software engineering experience. I would pip install but I'm not sure where the virtual environment to this is.

Steps to reproduce

Update HA core to 2024.11.0 and restart HA.

Expected behaviour

Tuya_local devices should continue to work.

Additional context

Tuya_local devices all shows "Not loaded" and error shows in logs that tinytuya did not import.

Confirmation

mark-harmison commented 2 weeks ago

Follow up information:

I was able to get the integration working for now by manually pip install tinytuya in the docker container.

make-all commented 2 weeks ago

If you manage things manually, you have to deal with dependencies yourself. Installing through HACS should take care of dependencies for you.

I can only support the integration itself, not everyone's personal environment.

mark-harmison commented 2 weeks ago

Thank you for your hard work on this integration.

I actually did install the integration through HACS and have done all HA operations through the UI. Only as a diagnostic and an attempt to get my devices working again did I resort to installing tinytuya manually. In doing this I think I have confirmed that all that is wrong is that the tinytuya package was not installed for some reason following the 2024.11.0 HA Core update.

It is certainly my intent and desire to do everything through HACS, which is precisely why I reported the bug.

I hope this clarifies the issue and please feel free to comment back if you need any further information. I would hate for other people to have to discover and report this same issue.

make-all commented 1 week ago

It is probably a recent change in Home Assistant, as I see there are other reporting it now with other integrations.

https://www.reddit.com/r/homeassistant/comments/1gr18pt/custom_component_requirements_not_bring_installed/

Nikolay-Ch commented 1 week ago

But why is not TuyaLocal problem, @make-all ? Dependencies need to be installed by extension, not by core HA... Because this dependency used only by TuyaLocal extension... Moreover this dependency: tinytuya I also get this error. I can't use your extension.

make-all commented 1 week ago

Integrations cannot install anything. It is the responsibility of whatever is installing them to install the dependencies declared in the manifest, whether that is HACS or the user who chooses to maintain their installation manually.

Nikolay-Ch commented 1 week ago

Integrations cannot install anything. It is the responsibility of whatever is installing them to install the dependencies declared in the manifest, whether that is HACS or the user who chooses to maintain their installation manually.

You are right... in my case the problem was in incorrect behavior of HA without root rights