AttributeError: module 'eikon' has no attribute 'set_app_key'

Hello. I just started using the eikon API. When I try to use the example scripts in the website, I get this error. I tried the solutions in the two similar questions, namely pip upgrade eikon and adding to the path, but it didnt work. Thanks in advance.

Best Answer

  • You possibly mixed different versions.

    A solution is to uninstall then re-install eikon library.

    set_app_key replaced set_app_id since 0.1.12 beta version.

    If you check helper on set_app_xxx functions :

    >>> help(ek.set_app_id)
    Help on function set_app_id in module eikon.Profile:

    set_app_id(app_id)
    Set the application id.

    Parameters
    ----------
    app_id : string
    the application id

    Notes
    -----
    The application ID identifies your application on Refinitiv Platform.
    You can get an application ID using the App Key Generator. This App is available in Eikon Desktop.

    .. deprecated:: 0.1.12
    This will be removed in 1.1.0. Use set_app_key function instead
    >>> help(ek.set_app_key)
    Help on function set_app_key in module eikon.Profile:

    set_app_key(app_key)
    Set the application key.

    Parameters
    ----------
    app_key : string
    the application key
    Notes
    -----
    The app key identifies your application on Refinitiv Platform.
    You can get an application ID using the App Key Generator. This App is available in Eikon Desktop.

    Regards

Answers

  • Are you sure that you upgraded to eikon 1.0.0 release version ?
    You can check version in Python console :

    >> import eikon
    >> eikon.__version__

    => You should have '1.0.0' result

  • Yes, It says 1.0.0

  • I don't see how this is possible. Version 1.0.0 of eikon library certainly implements set_app_key function, you can check it yourself by opening the source code. Are you executing eikon.__version__ and eikon.set_app_key calls in the same Python script? Or are you perhaps mixing several environments where you may have different versions of eikon library installed?

  • I just installed it this morning and only use Spyder. Weirdest thing is that i changed "set_app_key" to "set_app_id" like in the previous version and yet it gives the same error "eiko has no attribute named set_app_key", not Id, but key