Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

avatar image
Question by oliverbbeaumont · Jan 17 at 12:25 PM · eikon-data-apipythonapp-key

Problem Verifying Eikon API App Key

I'm currently stuck at the very first hurdle trying to get the Refinitiv Eikon API working with Python.

My code:

import eikon as ek # the Eikon Python wrapper package

import numpy as np # NumPy

import pandas as pd # pandas

import configparser as cp

print(ek.__version__)

ek.set_app_key('my app key here')


The response from this I get is:

AttributeError                            Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_15812/3514278165.py in <module>
      8 print(ek.__version__)
      9 ---> 10 ek.set_app_key('removed - will add below as private comment')

~\Miniconda3\envs\refinitiv\lib\site-packages\eikon\Profile.py in set_app_key(app_key)
     31     You can get an app key using the App Key Generator (this App is available in Eikon Desktop).
     32     """
---> 33     get_profile().set_app_key(app_key)
     34      35 
~\Miniconda3\envs\refinitiv\lib\site-packages\eikon\Profile.py in set_app_key(self, app_key)
    221                 self._desktop_session._app_key = app_key  # = DesktopSession(app_key, self._on_state, self._on_event)
    222             else:
--> 223                 self._desktop_session = DesktopSession(app_key=app_key,
    224                                                        on_state= self._on_state,
    225                                                        on_event=self._on_event) 
~\Miniconda3\envs\refinitiv\lib\site-packages\eikon\streaming_session\desktop_session.py in __init__(self, app_key, on_state, on_event, **kwargs)
     23      24     def __init__(self, app_key, on_state=None, on_event=None, **kwargs):
---> 25         super().__init__(app_key=app_key,
     26                          on_state=on_state,
     27                          on_event=on_event,

~\Miniconda3\envs\refinitiv\lib\site-packages\eikon\streaming_session\session.py in __init__(self, app_key, on_state, on_event, token, dacs_user_name, dacs_position, dacs_application_id)
    216         self._timeout = 60
    217         timeout = httpx.Timeout(self._timeout)
--> 218         self._http_session = httpx.AsyncClient(
    219             headers={"Accept": "application/json"},
    220             timeout=timeout,

~\Miniconda3\envs\refinitiv\lib\site-packages\httpx\_client.py in __init__(self, auth, params, headers, cookies, verify, cert, http1, http2, proxies, mounts, timeout, follow_redirects, limits, max_redirects, event_hooks, base_url, transport, app, trust_env)
   1378         proxy_map = self._get_proxy_map(proxies, allow_env_proxies)
   1379 -> 1380         self._transport = self._init_transport(
   1381             verify=verify,
   1382             cert=cert,

~\Miniconda3\envs\refinitiv\lib\site-packages\httpx\_client.py in _init_transport(self, verify, cert, http1, http2, limits, transport, app, trust_env)
   1426             return ASGITransport(app=app)
   1427 -> 1428         return AsyncHTTPTransport(
   1429             verify=verify,
   1430             cert=cert,

~\Miniconda3\envs\refinitiv\lib\site-packages\httpx\_transports\default.py in __init__(self, verify, cert, http1, http2, limits, trust_env, proxy, uds, local_address, retries)
    231     232         if proxy is None:
--> 233             self._pool = httpcore.AsyncConnectionPool(
    234                 ssl_context=ssl_context,
    235                 max_connections=limits.max_connections,

~\Miniconda3\envs\refinitiv\lib\site-packages\httpcore\_async\connection_pool.py in __init__(self, ssl_context, max_connections, max_keepalive_connections, keepalive_expiry, http1, http2, retries, local_address, uds, network_backend)
    109         self._pool: List[AsyncConnectionInterface] = []
    110         self._requests: List[RequestStatus] = []
--> 111         self._pool_lock = AsyncLock()
    112         self._network_backend = (
    113             AutoBackend() if network_backend is None else network_backend 
~\Miniconda3\envs\refinitiv\lib\site-packages\httpcore\_synchronization.py in __init__(self)
     10 class AsyncLock:
     11     def __init__(self) -> None:
---> 12         self._lock = anyio.Lock()
     13      14     async def __aenter__(self) -> "AsyncLock":

AttributeError: module 'anyio' has no attribute 'Lock'

Eikon = 1.1.14

Anyio = 3.4.0


If someone could offer some help I'd be very grateful, thanks

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by umer.nalla · Jan 17 at 04:36 PM

Hi @oliverbbeaumont

I removed your appkey from the above error output as it is your private credential.

However, I did try to use the above appkey with Eikon inside JupyterLabs and it is working fine on my PC.

1642436275795.png

Can you try the following:

import anyio
anyio.Lock()

Also, check the ~\Miniconda3\envs\refinitiv\lib\site-packages folder to confirm the version

1642437232593.png

There are also some existing threads related to this issue with further diagnostics / suggestions:

Error: module 'anyio' has no attribute 'Lock' - Forum | Refinitiv Developer Community

Error: AttributeError Traceback (most recent call last) - Forum | Refinitiv Developer Community

AttributeError: module 'anyio' has no attribute 'Lock' - Forum | Refinitiv Developer Community

One of the suggestions is to downgrade anyio to v3.2.1 which solved the issue for more than one user.



1642436275795.png (17.2 KiB)
1642437232593.png (6.4 KiB)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
11 People are following this question.

Related Questions

How to get all investors for a list of stocks, historically with the python API

EIKON Data API : ek.set_app_key()doesn't work.

App Key Generator Error

Any way to be connected real time (PYTHON)

Problem linking Eikon terminal to python

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges