Xenomes / Domoticz-TUYA-Plugin

Implements the special Tuya Home Assistant API.
22 stars 8 forks source link

failed to load 'plugin.py' #37

Closed vespino closed 1 year ago

vespino commented 1 year ago

I have been getting these errors as of lately:

2023-03-14 07:47:31.516 Error: Tuya: (tuya) failed to load 'plugin.py', Python Path used was '/opt/domoticz/userdata/plugins/Domoticz-TUYA-Plugin/:/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-03-14 07:47:31.530 Error: Tuya: Exception: 'SyntaxError'. No traceback available.

This results in not being able to control Tuya devices.

Xenomes commented 1 year ago

His is not an error of the plugin. Your installation is missing something from Python.

vespino commented 1 year ago

Any idea as to what? I have since tried another plugin and that one does work out of the box.

Xenomes commented 1 year ago

By the strange location of the plugin, any chance you are using Domoticz docker?

vespino commented 1 year ago

Yes I am. No problems before btw.

Xenomes commented 1 year ago

The plugin is fixed.

vespino commented 1 year ago

Tried it, without success.

Xenomes commented 1 year ago

Did you do a git pull in the directory of the plugin? Do you have a error?

vespino commented 1 year ago

I did a complete rebuild and all seems to be working now. Thanks!

snelweg commented 1 year ago

Updated everything and the plugin stopped working.

This is the error I get in the Domoticz log.

2023-06-06 16:18:35.653 Error: tuya: (tuya) failed to load 'plugin.py', Python Path used was '/home/ton/domoticz/plugins/Domoticz-TUYA-Plugin/:/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-06-06 16:18:35.656 Error: tuya: Traceback (most recent call last): 2023-06-06 16:18:35.656 Error: tuya: File "/home/ton/domoticz/plugins/Domoticz-TUYA-Plugin/plugin.py", line 65, in 2023-06-06 16:18:35.656 Error: tuya: import tuyaha 2023-06-06 16:18:35.656 Error: tuya: File "/usr/local/lib/python3.9/dist-packages/tuyaha/init.py", line 2, in 2023-06-06 16:18:35.656 Error: tuya: from .tuyaapi import TuyaApi 2023-06-06 16:18:35.656 Error: tuya: File "/usr/local/lib/python3.9/dist-packages/tuyaha/tuyaapi.py", line 4, in 2023-06-06 16:18:35.656 Error: tuya: import requests 2023-06-06 16:18:35.656 Error: tuya: File "/usr/local/lib/python3.9/dist-packages/requests/init.py", line 48, in 2023-06-06 16:18:35.656 Error: tuya: from charset_normalizer import version as charset_normalizer_version 2023-06-06 16:18:35.656 Error: tuya: File "/usr/local/lib/python3.9/dist-packages/charset_normalizer/init.py", line 24, in 2023-06-06 16:18:35.656 Error: tuya: from .api import from_bytes, from_fp, from_path 2023-06-06 16:18:35.656 Error: tuya: File "/usr/local/lib/python3.9/dist-packages/charset_normalizer/api.py", line 5, in 2023-06-06 16:18:35.656 Error: tuya: from .cd import ( 2023-06-06 16:18:35.656 Error: tuya: File "/usr/local/lib/python3.9/dist-packages/charset_normalizer/cd.py", line 9, in 2023-06-06 16:18:35.656 Error: tuya: from .md import is_suspiciously_successive_range 2023-06-06 16:18:35.656 Error: tuya: SystemError: initialization of md__mypyc did not return an extension module

Requirement already satisfied: tuyaha in /usr/local/lib/python3.9/dist-packages (0.0.11) Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (2.31.0) Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.9/dist-packages (from requests) (3.1.0) Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests) (2020.6.20) Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/lib/python3/dist-packages (from requests) (1.26.5) Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests) (2.10)

Xenomes commented 1 year ago

The development of Tuyaha has stopped, so I think your requests module is too high. Can you downgrade to 2.23.0? sudo pip3 install requests==2.23.0

vespino commented 1 year ago

I’m using “pip3 install tuyaha requests“ and currently having no issues.

snelweg commented 1 year ago

The development of Tuyaha has stopped, so I think your requests module is too high. Can you downgrade to 2.23.0? sudo pip3 install requests==2.23.0

great! That was the solution! Thank you

Xenomes commented 1 year ago

Thank you for reporting back, i will update the instructions.