Eikon API: AttributeError: type object 'SettingsFrame' has no attribute 'ENABLE_CONNECT_PROTOCOL'

Hi,

We're trying to get user started with Eikon Data API in Pycharm, but are getting the following error: AttributeError: type object 'SettingsFrame' has no attribute 'ENABLE_CONNECT_PROTOCOL'.

Eikon package has been installed succesfully and this is the error we're getting when trying to run the first bit of code.

How to get up and running?


--------------------------------------

Code:


import eikon as ek

ek.set_app_key('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')

df, err = ek.get_data(

instruments = ['NOKIA.HE'],

fields = ['TR.PriceClose'],

parameters={'Sdate':'2020-10-05'}

)

display(df)



-----------------------------

runfile('K:/Scriptit/untitled1.py', wdir='K:/Scriptit')

Traceback (most recent call last):


File "<ipython-input-5-e7c8c82f5d07>", line 1, in <module>

runfile('K:/Scriptit/untitled1.py', wdir='K:/Scriptit')


File "C:\PR\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile

execfile(filename, namespace)


File "C:\PR\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile

exec(compile(f.read(), filename, 'exec'), namespace)


File "K:/Scriptit/untitled1.py", line 8, in <module>

import eikon as ek


File "C:\PR\Anaconda3\lib\site-packages\eikon\__init__.py", line 12, in <module>

from .Profile import *


File "C:\PR\Anaconda3\lib\site-packages\eikon\Profile.py", line 17, in <module>

from .streaming_session import DesktopSession


File "C:\PR\Anaconda3\lib\site-packages\eikon\streaming_session\__init__.py", line 3, in <module>

from .session import *


File "C:\PR\Anaconda3\lib\site-packages\eikon\streaming_session\session.py", line 8, in <module>

import httpx


File "C:\PR\Anaconda3\lib\site-packages\httpx\__init__.py", line 2, in <module>

from ._api import delete, get, head, options, patch, post, put, request, stream


File "C:\PR\Anaconda3\lib\site-packages\httpx\_api.py", line 4, in <module>

from ._client import Client, StreamContextManager


File "C:\PR\Anaconda3\lib\site-packages\httpx\_client.py", line 25, in <module>

from ._dispatch.connection_pool import ConnectionPool


File "C:\PR\Anaconda3\lib\site-packages\httpx\_dispatch\connection_pool.py", line 16, in <module>

from .connection import HTTPConnection


File "C:\PR\Anaconda3\lib\site-packages\httpx\_dispatch\connection.py", line 11, in <module>

from .http2 import HTTP2Connection


File "C:\PR\Anaconda3\lib\site-packages\httpx\_dispatch\http2.py", line 3, in <module>

import h2.connection


File "C:\PR\Anaconda3\lib\site-packages\h2\connection.py", line 23, in <module>

from .events import (


File "C:\PR\Anaconda3\lib\site-packages\h2\events.py", line 14, in <module>

from .settings import ChangedSetting, _setting_code_from_int


File "C:\PR\Anaconda3\lib\site-packages\h2\settings.py", line 20, in <module>

class SettingCodes(enum.IntEnum):


File "C:\PR\Anaconda3\lib\site-packages\h2\settings.py", line 55, in SettingCodes

ENABLE_CONNECT_PROTOCOL = SettingsFrame.ENABLE_CONNECT_PROTOCOL


AttributeError: type object 'SettingsFrame' has no attribute 'ENABLE_CONNECT_PROTOCOL'







Answers

  • Hello @mikael.lehto,

    To me, this does not look familiar among common issues. I see what appears to be the same issue described in this GitHub discussion, I would give this recommendation a try first.

    If this does not help, next, I would suggest to verify your installation of EDAPI by reviewing and following Eikon Data API(Python) Troubleshooting | Refinitiv.

    Let us know how this works.

    Thanks

  • Hi,

    Could you check dependecy version with 'pip list' command and share the result ?

    According to the traceback, httpx ssems to be in a wrong version: it should be 0.14.*
    (you can force the right version with 'pip install httpx==0.14.3' command)


  • Thank you Zoya and Pierre! We're checking this with the user and will revert still if it doesn't work.

  • Hello,

    I have now updated httpx to 0.14.3 and h2 to 4.0.0.

    Eikon API version 1.1.7

    Desktop version:

    image

    Unable to get the log file from the troubleshooting guide..... But other steps ok, up until execution of code.

    Still getting the same error.

    Any workarounds?


    Thanks.

  • @mikael.lehto

    If the error is:

    ENABLE_CONNECT_PROTOCOL = SettingsFrame.ENABLE_CONNECT_PROTOCOL

    AttributeError: type object 'SettingsFrame' has no attribute 'ENABLE_CONNECT_PROTOCOL'

    You need to verify the version of hyperframe library.

    The hyperframe should be 5.2 or above which contains ENABLE_CONNECT_PROTOCOL.

        #: The byte that signals SETTINGS_ENABLE_CONNECT_PROTOCOL setting.
        ENABLE_CONNECT_PROTOCOL = 0x08


  • Hello,

    I am actually the one with the problem (not Mikael), and I have now checked that I have hyperframe version 5.2.0. Still does not work.

    Please advise.



  • @Julius.uotila

    Can you share the full error message?

  • Here you go:



    Traceback (most recent call last):

    File "<ipython-input-14-c358c9483937>", line 1, in <module>
    runfile('C:/Users/B716548/OneDrive - OP/Scriptit/untitled0.py', wdir='C:/Users/B716548/OneDrive - OP/Scriptit')

    File "C:\PR\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
    execfile(filename, namespace)

    File "C:\PR\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

    File "C:/Users/B716548/OneDrive - OP/Scriptit/untitled0.py", line 1, in <module>
    import eikon as ek

    File "C:\PR\Anaconda3\lib\site-packages\eikon\__init__.py", line 12, in <module>
    from .Profile import *

    File "C:\PR\Anaconda3\lib\site-packages\eikon\Profile.py", line 17, in <module>
    from .streaming_session import DesktopSession

    File "C:\PR\Anaconda3\lib\site-packages\eikon\streaming_session\__init__.py", line 3, in <module>
    from .session import *

    File "C:\PR\Anaconda3\lib\site-packages\eikon\streaming_session\session.py", line 8, in <module>
    import httpx

    File "C:\PR\Anaconda3\lib\site-packages\httpx\__init__.py", line 2, in <module>
    from ._api import delete, get, head, options, patch, post, put, request, stream

    File "C:\PR\Anaconda3\lib\site-packages\httpx\_api.py", line 4, in <module>
    from ._client import Client, StreamContextManager

    File "C:\PR\Anaconda3\lib\site-packages\httpx\_client.py", line 25, in <module>
    from ._dispatch.connection_pool import ConnectionPool

    File "C:\PR\Anaconda3\lib\site-packages\httpx\_dispatch\connection_pool.py", line 16, in <module>
    from .connection import HTTPConnection

    File "C:\PR\Anaconda3\lib\site-packages\httpx\_dispatch\connection.py", line 11, in <module>
    from .http2 import HTTP2Connection

    File "C:\PR\Anaconda3\lib\site-packages\httpx\_dispatch\http2.py", line 3, in <module>
    import h2.connection

    File "C:\PR\Anaconda3\lib\site-packages\h2\connection.py", line 23, in <module>
    from .events import (

    File "C:\PR\Anaconda3\lib\site-packages\h2\events.py", line 14, in <module>
    from .settings import ChangedSetting, _setting_code_from_int

    File "C:\PR\Anaconda3\lib\site-packages\h2\settings.py", line 20, in <module>
    class SettingCodes(enum.IntEnum):

    File "C:\PR\Anaconda3\lib\site-packages\h2\settings.py", line 55, in SettingCodes
    ENABLE_CONNECT_PROTOCOL = SettingsFrame.ENABLE_CONNECT_PROTOCOL

    AttributeError: type object 'SettingsFrame' has no attribute 'ENABLE_CONNECT_PROTOCOL'

  • @Julius.uotila

    From the call stack:

    File "C:\PR\Anaconda3\lib\site-packages\httpx\_dispatch\connection_pool.py", line 16, in <module>from .connection import HTTPConnection 

    I have checked the source code of httpx 0.14.3 and found that it doesn't have httpx\_dispatch folder.

    image

    I found httpx\_dispatch folder in the httpx-0.12.1.

    image

    Please check the version again in this directory (C:\PR\Anaconda3\lib\site-packages).

  • @Julius.uotila

    Please let us know if we have any updates on this issue.

  • Hello,

    Thanks, I have got through that problem now, but I am having a new one as below:

    Any help?

    1.1.7
    2020-11-06 16:27:12,277 P[8664] [MainThread 2488] Error on handshake port 9060 : TimeoutException("TimeoutException on HTTP request: ReadTimeout('')")
    2020-11-06 16:27:33,338 P[8664] [MainThread 2488] Error code 500 | Server Error: {"code":500,"message":"connect ETIMEDOUT 159.220.1.19:443","statusMessage":"Internal Server Error"}
    2020-11-06 16:27:33,342 P[8664] [MainThread 2488] HTTP request failed: EikonError-Server Error: {"code":500,"message":"connect ETIMEDOUT 159.220.1.19:443","statusMessage":"Internal Server Error"}
    Traceback (most recent call last):

    File "<ipython-input-6-c358c9483937>", line 1, in <module>
    runfile('C:/Users/B716548/OneDrive - OP/Scriptit/untitled0.py', wdir='C:/Users/B716548/OneDrive - OP/Scriptit')

    File "C:\PR\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
    execfile(filename, namespace)

    File "C:\PR\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

    File "C:/Users/B716548/OneDrive - OP/Scriptit/untitled0.py", line 10, in <module>
    parameters = {'SDate':'2020-10-05'}

    File "C:\PR\Anaconda3\lib\site-packages\eikon\data_grid.py", line 192, in get_data
    if result.get('responses'):

    AttributeError: 'NoneType' object has no attribute 'get'

  • @Julius.uotila

    Are you still experiencing this problem? The error message appears to be generated by Refinitiv backend. If the problem persists, I suggest you raise it to Refinitiv Helpdesk. The Helpdesk can be reached by using Contact Us capability in your Eikon application or by visiting MyRefinitiv. We would very much appreciate if you could update this thread with the latest status of the issue. Thank you.

  • It appears that a simple:

    conda install h2==3.2.0

    fixed the problem. For some reason it really wasn't liking h2 v4.0.0


  • @michael-r.meyer

    I think you posted this comment on the wrong thread. Did you mean to post it here? If yes, could you please update the right thread? Thank you.