For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 1 1

Problem using Eikon on Python

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!

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
23k 22 9 14

Hello @berkay.olken,

I run python 3.8.5. I am on eikon 1.10 as well, the latest.

My env:

PS C:\ProgramData\Anaconda3> ./python -m pip list | findstr date
navigator-updater             0.2.1
python-dateutil               2.8.1
PS C:\ProgramData\Anaconda3>

I believe datetime is part of python-dateutil, and does not need to be installed explicitly.

Can you run

pip check

? It should report any missing dependencies. If there is none, then you should have the requirements for eikon module installed.


Do you continue seeing "request failed" error on EDAPI example run? If you do, at this point I think the root cause may be due to network connectivity, same as prevents you from pulling external modules via pip. Please see this related discussion. I would suggest at this point to contact your network admin/team and find out more about your organization's requirements to establish the external connectivity.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
23k 22 9 14

Hello @berkay.olken,

It looks like, you are behind a firewall, and even though the latest eikon library looks to be installed via conda, some dependencies may be missing, you may try to install them separately, as discussed in this previous discussion thread.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
1 1 1 1

Hello Zoya Farberov,

Thank you for the answer. Yes actually I tried to do that already. Dependencies are as follows:

Name: eikon

Version: 1.1.10

Summary: Python package for retrieving Eikon data.

Home-page: https://developers.refinitiv.com/eikon-apis/eikon-data-api

Author: REFINITIV

Author-email:

License: Apache 2.0

Location: c:\temp\anaconda3\envs\refinitiv\lib\site-packages

Requires: datetime, httpx, pandas, numpy, nest-asyncio, deprecation, python-dateutil, websocket-client, appdirs

When I check the status of dependencies from my conda list:

# Name Version Build Channel

httpx 0.17.1 pyhd3eb1b0_0

pandas 1.1.3 py38ha925a31_0

numpy 1.19.2 py38hadc3359_0

nest-asyncio 1.4.2 pyhd3eb1b0_0

deprecation 2.1.0 pyh9f0ad1d_0 conda-forge

python-dateutil 2.8.1 py_0

websocket-client 0.57.0 py38haa244fe_4 conda-forge

appdirs 1.4.4 py_0

the only missing one is datetime module, but when I try to conda install datetime, but I think it does not install it properly. In order to download datetime module, I am using the instructions here: Datetime :: Anaconda.org. The command "conda install -c trentonoliphant datetime" is resulted as follows:


Collecting package metadata (current_repodata.json): done

Solving environment: failed with initial frozen solve. Retrying with flexible solve.

Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.

Collecting package metadata (repodata.json): done

Solving environment: failed with initial frozen solve. Retrying with flexible solve.

Solving environment: /

Found conflicts! Looking for incompatible packages.

This can take several minutes. Press CTRL-C to abort.

failed

UnsatisfiableError: The following specifications were found

to be incompatible with the existing python installation in your environment:

Specifications:

- datetime -> python[version='2.6.*|2.7.*|3.3.*|3.4.*']

Your python: python=3.8

If python is on the left-most side of the chain, that's the version you've asked for.

When python appears to the right, that indicates that the thing on the left is somehow

not available for the python version you are constrained to. Note that conda will not

change your python version to a different minor version unless you explicitly specify

that.


So clearly the python version (3.8.5) is not suitable for this old module, but since the module is a dependency for Eikon module and Eikon module is working on python 3.8, I could not understand why its giving me this error. Do you have any suggestion on this issue? All other dependencies seem okay and if I solve the problem related with datetime module, then I might be able to make it work.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea