Error on reading ltp

Exception at calling ltp as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: None, ‘error_type’: None, ‘error_message’: None}, ‘data’: ‘’}
Traceback (most recent call last):
File “MarketRobo.py”, line 37, in
ltp = ltp_for_all_script[name]
KeyError: ‘TCS’

Keep getting this error after few loop, it works for 5-10 While loops then keep getting this error.

Please suggest the fix

while True:
watchlist = Live_Trading.range(‘A2’).expand(‘down’).value #1. Read the Watchlist
current_time = datetime.datetime.now()
print("While Loop Started ", current_time, “\n\n”)
ltp_for_all_script = tsl.get_ltp_data(names = watchlist) #Get the LTP data from watchlist in one go

for name in watchlist: 
	#pdb.set_trace()
	#ltp 			= tsl.get_ltp_data(names = name)[name] #2. Get the LTP one by one
	ltp 			= ltp_for_all_script[name]

	if name in ('NIFTY', 'BANKNIFTY', 'SENSEX'):
			exchange_name = 'INDEX'
	else:
			exchange_name = 'NSE'

	chart 			= tsl.get_historical_data(tradingsymbol = name, exchange = exchange_name, timeframe = "5") #3. Get the historical data   'INDEX' if name in ('NIFTY', 'SENSEX') else 'NSE'

Hi @suryakant_kumar ,

Thanks for bringing this up. @Tradehull_Imran may be able to assist here

Hi @suryakant_kumar ,

Which version of codebase have you been using? Do run the below code in cmd and share the screenshot-

where python
pip show dhanhq
pip show Dhan-Tradehull

Hi, I am using Dhan_Tradehull_V2.py version: 3.1.2

I also got the same error this morning.. But it goes away when I delete the all_instrument Excel.