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

ImportError: cannot import name 'Literal' from 'typing' using python 3.7.9 #60

Open
naomi-choy opened this issue Jun 29, 2022 · 0 comments

Comments

@naomi-choy
Copy link

trying to run api.py from example, it shows the following errors:

File "api.py", line 2, in
from tuya_iot import TuyaOpenAPI, tuya_logger
File "C:\Users\yolo\AppData\Local\Programs\Python\Python37\lib\site-packages\tuya_iot_init_.py", line 2, in
from .device import TuyaDevice, TuyaDeviceListener, TuyaDeviceManager
File "C:\Users\yolo\AppData\Local\Programs\Python\Python37\lib\site-packages\tuya_iot\device.py", line 7, in
from typing import Any, Literal, Optional
ImportError: cannot import name 'Literal' from 'typing'

changing the import routes in device.py to from typing_extensions import Literal as suggested in stackoverflow gives the following error:

File "api.py", line 2, in
from tuya_iot import TuyaOpenAPI, tuya_logger
ImportError: cannot import name 'tuya_logger' from 'tuya_iot'

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

1 participant