question

Upvotes
1 0 0 1

Error getting started with Reuters dataplatfom in Python

I am following this tutorial as best as I can: https://developers.refinitiv.com/en/article-catalog/article/getting-start-with-refinitiv-data-platform


I have installed Eikon like so:

pip install eikon


and I have installed Refinitiv dataplatform like so:

pip install refinitiv.dataplatform


and when running pip list I see the following installations (and many more)

pip list
Package                Version
---------------------- --------------
...
eikon                  1.1.14
...
refinitiv-dataplatform 1.0.0a11.post1
...


in this (miniconda) environment I launch jupyter notebook and run the following to commands in a notebook cell:

import eikon as ek
import refinitiv.dataplatform as rdp


which fails like this - sorry for the long traceback

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-8ef34ae7a676> in <module>
      1 import eikon as ek
----> 2 import refinitiv.dataplatform as rdp

~.conda\envs\rdptut\lib\site-packages\refinitiv\dataplatform\__init__.py in <module>
      7 
      8 from .errors import *
----> 9 from .core import *  # noqa
     10 from .content import *  # noqa
     11 from .delivery import *  # noqa

~.conda\envs\rdptut\lib\site-packages\refinitiv\dataplatform\core\__init__.py in <module>
      2 
      3 # from . import session
----> 4 from .session import Session  # noqa
      5 from .session import DesktopSession  # noqa
      6 from .session import PlatformSession  # noqa

~.conda\envs\rdptut\lib\site-packages\refinitiv\dataplatform\core\session\__init__.py in <module>
     10 # from . import global_settings
     11 
---> 12 from .session import *  # noqa
     13 from .grant_refresh import *  # noqa
     14 from .grant_password import *  # noqa

~.conda\envs\rdptut\lib\site-packages\refinitiv\dataplatform\core\session\session.py in <module>
     27 from refinitiv.dataplatform.tools._common import urljoin
     28 
---> 29 from refinitiv.dataplatform.delivery.stream.omm_stream_connection import (
     30     OMMStreamConnection,
     31 )

~.conda\envs\rdptut\lib\site-packages\refinitiv\dataplatform\delivery\__init__.py in <module>
      2 
      3 from .stream import *  # noqa
----> 4 from .data import *  # noqa
      5 
      6 del stream

~.conda\envs\rdptut\lib\site-packages\refinitiv\dataplatform\delivery\data\__init__.py in <module>
      3 # from ...tools import module_helper
      4 
----> 5 from .endpoint import Endpoint  # noqa
      6 
      7 # from .data_accessor import DataAccessor

~.conda\envs\rdptut\lib\site-packages\refinitiv\dataplatform\delivery\data\endpoint.py in <module>
     13 from refinitiv.dataplatform.tools._common import urljoin, get_response_reason
     14 from refinitiv.dataplatform.errors import EndpointError
---> 15 from refinitiv.dataplatform.legacy import get_default_session
     16 
     17 

~.conda\envs\rdptut\lib\site-packages\refinitiv\dataplatform\legacy\__init__.py in <module>
      1 # coding: utf-8
      2 
----> 3 from .data_grid import get_data, TR_Field  # noqa
      4 from .json_requests import send_json_request  # noqa
      5 from .news_request import get_news_headlines, get_news_story  # noqa

~.conda\envs\rdptut\lib\site-packages\refinitiv\dataplatform\legacy\data_grid.py in <module>
      5 import pandas as pd
      6 import numpy
----> 7 import refinitiv.dataplatform.legacy.json_requests
      8 from .tools import (
      9     get_json_value,

~.conda\envs\rdptut\lib\site-packages\refinitiv\dataplatform\legacy\json_requests.py in <module>
      6 import time
      7 
----> 8 import refinitiv.dataplatform.vendor.requests_async as requests
      9 
     10 from refinitiv.dataplatform.tools._common import get_response_reason

AttributeError: module 'refinitiv' has no attribute 'dataplatform'


If I keep the import Eikon line only, then it works, however as soon as I add the second line with the refinitiv.dataplatform import, then it fails with the above error message.


Any ideas or suggestions on what to check next would be appreciated - and apologies if this is a basic question, it's the first time I'm trying to use the API.


refinitiv-dataplatform-eikon
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 0 0 1

I changed my setup to using these versions:

pip list
Package                Version
---------------------- --------------
...
eikon                  1.1.14
...
refinitiv-dataplatform 1.0.0a8.post1
...


and after that it works. Not 100% sure why this happens, but at least the problem is solved for now.

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.

Upvote
11.5k 16 7 10

Hello @henrik.karlsson

If you are using the Refinitiv Data Platform Libraries, the Python version of the libraries already has the Eikon Data API for you. You do not need to install the Eikon Data API separately.

Please find more detail regarding how to use the Eikon Data API module of the RDP Libraries from this 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.

Upvote
11.5k 16 7 10

Hello @henrik.karlsson

Additionally, I cannot replicate the issue in my environment with my local Jupyter Lab and Jupyter Notebook.

eikon-code.png

Note: I have installed Jupyter with the following command.

conda install -c conda-forge jupyterlab

eikon-code.png (67.0 KiB)
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