Closed kaustubhgupta closed 3 years ago
Fixed in #163
Describe the bug While importing the module, I am getting errors.
Command Run:
from pandasgui import show
Error:
ImportError: cannot import name 'Literal' from 'typing'
Environment OS: Windows 10 Python: 3.7.6 IDE: VSCode
Package versions
ipython==7.25.0 ipython-genutils==0.2.0 pandasgui==0.2.12 plotly==5.1.0 PyQt5==5.15.4 PyQt5-sip==12.9.0 PyQtWebEngine==5.15.4
Solution I found As per the StackOverflow answer,
typing.Literal
is only available from Python 3.8 and up.I tested this and found that it actually works in Python 3.8.10 without any errors but shows the import error in Python 3.7.6.
Therefore, following the answer, I found that typing_extensions can easily solve this error. In pandasgui < widgets < json_viewer.py:
try: from typing import Literal except ImportError: from typing_extensions import Literal
I replaced did this replacement and it worked in Python 3.7.6
Nice work!
Describe the bug
While importing the module, I am getting errors.
Command Run:
from pandasgui import show
Error:
Environment OS: Windows 10 Python: 3.7.6 IDE: VSCode
Package versions
Solution I found As per the StackOverflow answer,
typing.Literal
is only available from Python 3.8 and up.I tested this and found that it actually works in Python 3.8.10 without any errors but shows the import error in Python 3.7.6.![image](https://user-images.githubusercontent.com/43691873/126029591-c4f69c85-0304-4f94-987f-abec010dc2fa.png)
Therefore, following the answer, I found that typing_extensions can easily solve this error. In pandasgui < widgets < json_viewer.py: https://github.com/adamerose/PandasGUI/blob/db78e86c066bf2144bf0e7da90449097c87cb07a/pandasgui/widgets/json_viewer.py#L2
I replaced did this replacement and it worked in Python 3.7.6