Hello Everyone,
I am new to Anaconda/Python environment and trying to set the connection in between Eikon data API to use it on Python via Jupyter Notebook. I will provide some background information as side notes below, however if you need further details please let me know.
Note: I am on corporate environment, but I am not sure whether the errors are related with any of the firewalls or other missteps that I have done through the process.
Note: I am using Anaconda 3 interface and my Python version is 3.8.5 (however I also tried installing older versions of Python such as 3.7.4, but still got the errors).
So, I followed the instructions on the Eikon quick start webpage: https://developers.refinitiv.com/en/api-catalog/eikon/eikon-data-api/quick-start/quickstart-guide-for-windows
It was instructed to download the Eikon module on python using "pip install eikon" command. Yet, whenever I try to use this command (pip install <module name>), I got below/or similar errors:
--------Error on Prompt----------
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001EAA8D451C0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/datetime/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001EAA8D42DF0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/datetime/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001EAA8D42D00>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/datetime/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001EAA8D42BE0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/datetime/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001EAA8D42A90>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/datetime/
ERROR: Could not find a version that satisfies the requirement datetime (from eikon) (from versions: none)
ERROR: No matching distribution found for datetime (from eikon)
----------------------------------
Then I decided to download and install the Eikon module by "conda install eikon" command. It seems the latest version of module (Eikon 1.1.10) is installed, it appears in the conda list as:
# Name Version Build Channel
eikon 1.1.10 pyhd8ed1ab_0 conda-forge
Given that I thought it is installed, I tried some examples from the codebook on jupyter notebook, to see if it is working. It seems my app key is working. However, I am getting below error on notebook, even for the simplest codes:
--------------Error on Jupyter Notebook-------------
2021-04-20 23:02:54,687 P[9092] [MainThread 7044] Error code 500 | Server Error: {"code":500,"message":"getaddrinfo ENOTFOUND emea1.apps.cp.thomsonreuters.com emea1.apps.cp.thomsonreuters.com:443","statusMessage":"Internal Server Error"} 2021-04-20 23:02:54,692 P[9092] [MainThread 7044] HTTP request failed: EikonError-Server Error: {"code":500,"message":"getaddrinfo ENOTFOUND emea1.apps.cp.thomsonreuters.com emea1.apps.cp.thomsonreuters.com:443","statusMessage":"Internal Server Error"}
---------------------------------------------------------------------------
EikonError Traceback (most recent call last)
C:\TEMP\Anaconda3\lib\site-packages\eikon\json_requests.py in send_json_request(entity, payload, debug)
126 else:
--> 127 _raise_for_status(response)
128 except httpx.TimeoutException as timeout_exception:
C:\TEMP\Anaconda3\lib\site-packages\eikon\json_requests.py in _raise_for_status(response)
271 logger.error(u'Error code {} | {}'.format(response.status_code, error_msg))
--> 272 raise EikonError(response.status_code, error_msg)
EikonError: Error code 500 | Server Error: {"code":500,"message":"getaddrinfo ENOTFOUND emea1.apps.cp.thomsonreuters.com emea1.apps.cp.thomsonreuters.com:443","statusMessage":"Internal Server Error"}
During handling of the above exception, another exception occurred:
EikonError Traceback (most recent call last)
<ipython-input-2-071bc940ac2c> in <module>
----> 1 ek.get_news_headlines('R:LHAG.DE', date_from='2019-03-06T09:00:00', date_to='2019-03-06T18:00:00')
C:\TEMP\Anaconda3\lib\site-packages\eikon\news_request.py in get_news_headlines(query, count, date_from, date_to, raw_output, debug)
122 payload.update({'dateTo': to_datetime(date_to).isoformat()})
123 --> 124 result = eikon.json_requests.send_json_request(News_Headlines_UDF_endpoint, payload, debug=debug)
125 126 if raw_output:
C:\TEMP\Anaconda3\lib\site-packages\eikon\json_requests.py in send_json_request(entity, payload, debug)
132 except EikonError as eikon_err:
133 logger.error(f"HTTP request failed: {type(eikon_err).__name__}-{eikon_err.message}")
--> 134 raise EikonError(eikon_err.code, eikon_err.message)
135 except httpx.ConnectTimeout as connect_timeout:
136 logger.debug(f'HTTP ConnectTimeout: {connect_timeout}')
EikonError: Error code 500 | Server Error: {"code":500,"message":"getaddrinfo ENOTFOUND emea1.apps.cp.thomsonreuters.com emea1.apps.cp.thomsonreuters.com:443","statusMessage":"Internal Server Error"}
I tried with several other codes (both from instructions and codebook examples), but the errors that I shared above from the Jupyter notebook still exist. Also for the prompt window, I am not able to use any command related with "pip".
Could you please help me to diagnose and solve the above issues? Thank you so much for your time and help in advance!