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

Raised in behalf of user as he is getting this error though using the .NET library and so far he is having no problems. He has already installed version eikon-1.1.14.
Will share link to user for him to provide additional information.
Please see details below.
From Eikon API
[18]:
############# Eikon ###############
#https://developers.refinitiv.com/en/api-catalog/eikon/eikon-data-api/quick-start#quick-start-guide-for-windows
import eikon as ek
ek.set_app_key('##### EIKON APP KEY #####')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_15876/3524143416.py in <module>
2 #https://developers.refinitiv.com/en/api-catalog/eikon/eikon-data-api/quick-start#quick-start-guide-for-windows
3 import eikon as ek
----> 4 ek.set_app_key('##### EIKON APP KEY #####')
~\anaconda3\envs\eikon\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
~\anaconda3\envs\eikon\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)
~\anaconda3\envs\eikon\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,
~\anaconda3\envs\eikon\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,
~\anaconda3\envs\eikon\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,
~\anaconda3\envs\eikon\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,
~\anaconda3\envs\eikon\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,
~\anaconda3\envs\eikon\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
~\anaconda3\envs\eikon\lib\site-packages\httpcore\_synchronization.py in __init__(self)
10 class AsyncLock:
11 def __init__(self) -> None:
---> 12 self._lock = anyio.Lock()
Best Answer
-
Can you ask the user to check the version of the Anyio library using 'pip list' command? I'm using Anyio v3.2.1 with Eikon v1.1.14 and I couldn't reproduce the issue you found, even using the same app key provided.
If the user is using another version of Anyio, please ask them to upgrade the library. But if they're using the same version, there could be any other issue and I'll try to find the cause and how to fix it.
0
Answers
-
Hi @raksina.samasiri, based on piplis previously sent by user, he has anyio version 3.3.4.
0 -
hi @nelbert.guantero ,
Could you please ask the client to downgrade anyio to version 3.2.1 and try running the code again? it could be that his current version of anyio module does not match the interface expectation by eikon library 1.1.14.
0 -
Will do, @raksina.samasiri. Thanks.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 249 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛