Invalid syntax error

Dear sir,

requesting to help , how to solve below syntax error to get market historical data.

Unable to find acceptable character detection dependency (chardet or charset_normalizer).
warnings.warn(
Traceback (most recent call last):
File “learn.py”, line 6, in
from Dhan_Tradehull import Tradehull
File “C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\Dhan_Tradehull_init_.py”, line 1, in
from .Dhan_Tradehull import Tradehull
File “C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\Dhan_Tradehull\Dhan_Tradehull.py”, line 1, in
from dhanhq import DhanContext, dhanhq, FullDepth
File “C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\dhanhq_init_.py”, line 6, in
from ._super_order import SuperOrder
File “C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\dhanhq_super_order.py”, line 54
match str(leg_name).upper():
^
SyntaxError: invalid syntax

code details

image

HI @Narayan_p ,

The error is occurring because you are using an older version of Python. So follow the steps inside the link provided below to upgrade your Python version. Once the upgrade is completed, run the code again to retrieve the data.

Refer this link to upgrade -

https://madefortrade.in/t/dhan-tradehull-library-update-python-3-12-authentication-improvements/60729