mileperhour / localtuya-homeassistant

local handling for Tuya devices
GNU General Public License v3.0
147 stars 667 forks source link

ModuleNotFoundError: No module named 'pytuya' #7

Open cchalong opened 4 years ago

cchalong commented 4 years ago

Could I get any clue about below error msg? I'm in a trouble in setting up localtuya for several hours

Error while setting up platform localtuya Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 158, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for return fut.result() File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/localtuya/switch.py", line 44, in setup_platform import pytuya ModuleNotFoundError: No module named 'pytuya'

qntris commented 4 years ago

Hello, I have the same issue with getting an error "No module named 'pytuya'. Any updates?

SDNick484 commented 4 years ago

The local import of pytuya needs to be corrected from import pytuya to from . import pytuya in switch.py. There's a PR posted for this but it hasn't been merged.