tuya / tuya-iot-python-sdk

Tuya IoT Python SDK for Tuya Open API.
MIT License
117 stars 47 forks source link

ImportError: cannot import name 'Literal' from 'typing' (/usr/lib64/python3.7/typing.py) #42

Open EvilWizard99 opened 2 years ago

EvilWizard99 commented 2 years ago
line 1, in <module>
    from tuya_iot import TuyaOpenAPI
  File "/usr/local/lib/python3.7/site-packages/tuya_iot/__init__.py", line 2, in <module>
    from .device import TuyaDevice, TuyaDeviceListener, TuyaDeviceManager
  File "/usr/local/lib/python3.7/site-packages/tuya_iot/device.py", line 7, in <module>
    from typing import Any, Literal, Optional
ImportError: cannot import name 'Literal' from 'typing' (/usr/lib64/python3.7/typing.py)

https://github.com/python/typing/issues/707 explains that is how it's staying in 3.7 stdlib & suggests using typing_extensions

fhempy commented 2 years ago

@tsutsuku Can you please fix this to support Python 3.7 again? If you don't plan to fix it, update the Readme and remove Python 3.7 support please.