Hi, I am trying to get fundamental data using ek.get_data for the first time but the code hangs

I'm using Jupyter Notebook. import eikon as ek ek.set_app_key('') df, err = ek.get_data(['GOOG.O','MSFT.O', 'FB.O'], [ 'TR.Revenue','TR.GrossProfit']) the ek.get_data hangs, it doesn't raise an error and doesn't complete.

Best Answer

  • Problem solved. I had a version of Python installed that was not compatible with other installed package. It now works. Thanks for your suggestions.

Answers

  • Hi @barry.chapman

    I just tested the code and it works fine for me.

    image


    I am using Python 3.7.4 32bit

    I just would like to check the dependencies version.

    These are all the dependencies on my machine which works fine.

    Requirement already satisfied: eikon in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (1.1.9)
    Requirement already satisfied: appdirs>=1.4.3 in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from eikon) (1.4.3)
    Requirement already satisfied: websocket-client in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from eikon) (0.56.0)
    Requirement already satisfied: nest-asyncio>=1.5.1 in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from eikon) (1.5.1)
    Requirement already satisfied: deprecation in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from eikon) (2.0.6)
    Requirement already satisfied: datetime in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from eikon) (4.3)
    Requirement already satisfied: numpy>=1.11.0 in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from eikon) (1.16.4)
    Requirement already satisfied: httpx in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from eikon) (0.14.3)
    Requirement already satisfied: python-dateutil in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from eikon) (2.8.0)
    Requirement already satisfied: pandas>=1.0.0 in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from eikon) (1.1.0)
    Requirement already satisfied: six in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from websocket-client->eikon) (1.15.0)
    Requirement already satisfied: packaging in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from deprecation->eikon) (19.0)
    Requirement already satisfied: zope.interface in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from datetime->eikon) (4.6.0)
    Requirement already satisfied: pytz in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from datetime->eikon) (2019.3)
    Requirement already satisfied: sniffio in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from httpx->eikon) (1.2.0)
    Requirement already satisfied: chardet==3.* in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from httpx->eikon) (3.0.4)
    Requirement already satisfied: rfc3986[idna2008]<2,>=1.3 in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from httpx->eikon) (1.3.2)
    Requirement already satisfied: certifi in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from httpx->eikon) (2019.6.16)
    Requirement already satisfied: httpcore==0.10.* in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from httpx->eikon) (0.10.2)
    Requirement already satisfied: pyparsing>=2.0.2 in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from packaging->deprecation->eikon) (2.4.0)
    Requirement already satisfied: setuptools in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from zope.interface->datetime->eikon) (40.8.0)
    Requirement already satisfied: idna; extra == "idna2008" in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from rfc3986[idna2008]<2,>=1.3->httpx->eikon) (2.8)
    Requirement already satisfied: h11<0.10,>=0.8 in c:\users\****\appdata\local\programs\python\python37-32\lib\site-packages (from httpcore==0.10.*->httpx->eikon) (0.8.1)


    image

  • @barry.chapman Can I ask what version of Eikon, Eikon Library (ek.__version__) and python you are using. Please separate your code into two cells - in the first cell:

    import eikon as ek 
    ek.set_app_key('YOUR APP KEY HERE')
    ek.__version__

    and in the second cell:

    df, err = ek.get_data(['VOD.L'], ['TR.Revenue','TR.GrossProfit'])
    df

    Please run the first cell and post the result along with the other info and then try the second cell and see what happens. I hope this can help.

  • Thanks for the responses.

    Import eikon worked,

    then I ran the set_app_key, which complained because I didn't have Eikon open on my pc.

    After opening Eikon and I re-ran the ek.set_app_key key, which hung. There was no error, it just never completed.

    I then shut down jupyter notebook, repoened it and ran import eikon, and then ek.__version__ which returned1.1.9.

    I then ran set_app_key which appeared to work, but after that I ran ek.__version__, which this time took about 5 minutes to return 1.1.9

    the ek.get_data has been running for 10 mins.

    So maybe it's a network issue, but I'm not getting any other network issues.


  • Capture ek.JPG

    Here's a screenprint.

  • @barry.chapman Eikon always needs to be open when using the API as it uses an in-built proxy. Are you running on a corporate network? If so can you try running without connecting to your VPN? I think this might be some corporate firewall issue and that would confirm. Please try and let me know.

  • Thanks again, it looks like it's an issue with the setup on my PC, as the code works for another user in my organisation. I will look into my pc issues.

  • Hi, I have reinstalled the environment on my C drive instead of using the network drive but get the same issue, which is set_app_key works ok, but ek.__version__ takes many minutes to return. Are there any ways to look into why it would take so long? (I don't have any other network issues, and Eikon is working ok on the PC).