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

Failed to load 'plugin.py' Python Path #15

Open
blooesky opened this issue Jul 4, 2023 · 1 comment
Open

Failed to load 'plugin.py' Python Path #15

blooesky opened this issue Jul 4, 2023 · 1 comment

Comments

@blooesky
Copy link

blooesky commented Jul 4, 2023

Hi ,

I have this problem. When domoticz starts all is fine...but after a while...error. Especially if i want to update the plugin settings from domoticz and another situation when the plugin auto restart for data timeout.

2023-07-04 14:56:32.767 Error: Purificator Xiaomi: (AirPurifier) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/domoticz-AirPurifier/:/usr/lib/python39.zip:/usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.9/dist-packages'.
2023-07-04 14:56:32.781 Error: Purificator Xiaomi: Traceback (most recent call last):
2023-07-04 14:56:32.781 Error: Purificator Xiaomi: File "/home/pi/domoticz/plugins/domoticz-AirPurifier/plugin.py", line 73, in
2023-07-04 14:56:32.781 Error: Purificator Xiaomi: import miio.airpurifier
2023-07-04 14:56:32.781 Error: Purificator Xiaomi: File "/usr/local/lib/python3.9/dist-packages/miio/init.py", line 28, in
2023-07-04 14:56:32.781 Error: Purificator Xiaomi: from miio.discovery import Discovery
2023-07-04 14:56:32.781 Error: Purificator Xiaomi: File "/usr/local/lib/python3.9/dist-packages/miio/discovery.py", line 8, in
2023-07-04 14:56:32.781 Error: Purificator Xiaomi: import zeroconf
2023-07-04 14:56:32.781 Error: Purificator Xiaomi: File "/usr/local/lib/python3.9/dist-packages/zeroconf/init.py", line 25, in
2023-07-04 14:56:32.781 Error: Purificator Xiaomi: from ._cache import DNSCache # noqa # import needed for backwards compat
2023-07-04 14:56:32.781 Error: Purificator Xiaomi: ImportError: Interpreter change detected - this module can only be loaded into one interpreter per process.

Domoticz Beta v2023.1 (15375) an python 3.9 miio 0.4.5

Thanks

@manutremo
Copy link

manutremo commented Dec 20, 2024

This error is caused by one of the supporting libraries named PyO3 (possibly not in this library but in the python-miio one), which contains a limitation in that it can onyl be initialized once. That's why the plugin apparently works on start but then this error shows when the plugin restarts. The same happens when you have another plugin that uses the PyO3 module, or if you have two instances of the same plugin. That's my case since I have two purifiers and need to create two instances of the plugin. As of today the limitation is still there and the developer doesn't seem to be too motivated to fix it.

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

2 participants