I have a pretty simple python script to get Refinitiv Eikon Data into a dataframe.
import eikon as ek ek.set_app_key('api_key_goes_here') #real key would go here Instruments = ["USFN3015=TWEB","USFN30151=TWEB","USFN30152=TWEB"] Fields = [ek.TR_Field('CF_NAME'), ek.TR_Field('COUPN_RATE'), ek.TR_Field('CF_LAST')] Price_df, err = ek.get_data(Instruments,Fields) print (Price_df)
It was working from June until yesterday (10/14/2020) - I think it has something to do with Refinitiv being updated since it worked at 9am yesterday, Refinitiv updated at 10am, and now it's not working. The code works if I run it through the Eikon CodeBook console.
When I run it now, I get this error (I've removed some local directory paths):
Traceback (most recent call last): File "<ipython-input-2-29e2cc3d3014>", line 1, in <module> runfile('Test.py', wdir='') File "spydercustomize.py", line 827, in runfile execfile(filename, namespace) File "spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "Test.py", line 7, in <module> Price_df, err = ek.get_data(Instruments,Fields) File "AppData\Local\Continuum\anaconda3\lib\site-packages\eikon\data_grid.py", line 190, in get_data result = eikon.json_requests.send_json_request(_endpoint, payload, debug=debug) File "AppData\Local\Continuum\anaconda3\lib\site-packages\eikon\json_requests.py", line 145, in send_json_request if network_error: UnboundLocalError: local variable 'network_error' referenced before assignment
It looks like there are 2 issues:
1. The error handling in the Eikon "json_requests" doesn't seem to work as intended.
2. Somehow the eikon package has lost network access, or can't connect correctly?
I checked windows firewall and Refinitiv Eikon has access. I'm using python 3.7.3 and the eikon package version 1.1.6.post3. Any help on this would be really appreciated. Thank you.