eikon get_data never returning anything. no error message either.

Hi,
I am using python-3.8.3, eikon-1.1.6.post3 and PyCharm IDE
import eikon as ek # Works fine
ek.set_app_key('xxxx') # It takes like 10 secondes for the command prompt to return
df, err = ek.get_data('AAPL.O', ['TR.PriceClose']) # The command prompt never returns. No error message either.
Best Answer
-
Could you add following env variable :
HTTPX_LOG_LEVEL=trace
with PyCharm, add it in scrip environment as below:
then run your script and check if there is any error/warning or anything that could explain frozen request.
You should have additional HTTP logs like this:
TRACE [2020-09-29 00:12:09] httpx._config - load_verify_locations cafile=C:\Python\38\lib\site-packages\certifi\cacert.pem
...
DEBUG [2020-09-29 00:12:23] httpx._client - HTTP Request: POST http://localhost:9060/api/udf "HTTP/1.1 200 OK"
2020-09-29 00:12:23,604 P[12736] [MainThread 37772] HTTP Request: POST http://localhost:9060/api/udf "HTTP/1.1 200 OK"
TRACE [2020-09-29 00:12:23] httpcore._async.http11 - receive_event=Data(<258 bytes>)
2020-09-29 00:12:23,604 P[12736] [MainThread 37772] receive_event=Data(<258 bytes>)
TRACE [2020-09-29 00:12:23] httpcore._async.http11 - receive_event=EndOfMessage(headers=[])
2020-09-29 00:12:23,604 P[12736] [MainThread 37772] receive_event=EndOfMessage(headers=[])
TRACE [2020-09-29 00:12:23] httpcore._async.http11 - response_closed our_state=DONE their_state=DONE
2020-09-29 00:12:23,604 P[12736] [MainThread 37772] response_closed our_state=DONE their_state=DONE0
Answers
-
Hi,
Could you activate log (ek.set_log_level(10)), then execute your get_data() request and share the trace ?
Take care to hide your app_key renamed as application_id (see below)
You should have this :
df, err = ek.get_data('AAPL.O', ['TR.PriceClose'])
2020-09-27 18:08:38,342 P[3412] [MainThread 19428] entity: DataGrid_StandardAsync
2020-09-27 18:08:38,343 P[3412] [MainThread 19428] payload: {'requests': [{'instruments': ['AAPL.O'], 'fields': [{'name': 'TR.PriceClose'}]}]} 2020-09-27 18:08:38,344 P[3412] [MainThread 19428] Request:{'Entity': {'E': 'DataGrid_StandardAsync', 'W': {'requests': [{'instruments': ['AAPL.O'], 'fields': [{'name': 'TR.PriceClose'}]}]}}}
2020-09-27 18:08:38,347 P[3412] [MainThread 19428] Request to http://localhost:9060/api/v1/data
headers = {'Content-Type': 'application/json', 'x-tr-applicationid': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBcGlWZXJzaW9uIjoiMSIsIkFwcEtleSI6IjFmZGYwNmFmMTU3NjRkYzc5ZTI3ZmE0NzYwYmI3NzQ2NDY0MmU4ZjgiLCJBcHBTY29wZSI6InJhcGkiLCJMaWJyYXJ5TmFtZSI6IkVpa29uIFB5dGhvbiBMaWJyYXJ5IiwiTGlicmFyeVZlcnNpb24iOiIxLjEuNi5wb3N0MyIsImlhdCI6MTYwMTIyMjcwNiwiZXhwIjoxNjAyNDMyMzA2fQ.eYL6BIwpSDR0qNEpcfEg83zZzV_FSREIgYwqnT23D1Y'} params = None
2020-09-27 18:08:40,208 P[3412] [MainThread 19428] HTTP request response 200: {"responses":[{"columnHeadersCount":1,"data":[["AAPL.O",112.28]],"headerOrientation":"horizontal","headers":[[{"displayName":"Instrument"},{"displayName":"Price Close","field":"TR.PRICECLOSE"}]],"rowHeadersCount":1,"totalColumnsCount":2,"totalRowsCount":2}]}
2020-09-27 18:08:40,209 P[3412] [MainThread 19428] HTTP Response code: 200
2020-09-27 18:08:40,210 P[3412] [MainThread 19428] HTTP Response: {"responses":[{"columnHeadersCount":1,"data":[["AAPL.O",112.28]],"headerOrientation":"horizontal","headers":[[{"displayName":"Instrument"},{"displayName":"Price Close","field":"TR.PRICECLOSE"}]],"rowHeadersCount":1,"totalColumnsCount":2,"totalRowsCount":2}]}
2020-09-27 18:08:40,210 P[3412] [MainThread 19428] Response size: 327df
Out[4]:
InstrumentPrice Close0AAPL.O112.280 -
Hi @pierre.faurel
import eikon as ek
ek.set_log_level(10)
ek.set_app_key('xxxx')
2020-09-28 10:21:46,896 P[1536] [MainThread 10500] Send GET request to http://localhost:9060/api/status to detect API Proxy...
2020-09-28 10:21:46,897 P[1536] [MainThread 10500] Request to http://localhost:9060/api/status
headers = {'x-tr-applicationid': 'xxxx'}
params = None
2020-09-28 10:21:56,934 P[1536] [MainThread 10500] Checking port 9060 response : 200 - {"statusCode":"ST_PROXY_READY","version":"2.6.0"}
2020-09-28 10:21:56,935 P[1536] [MainThread 10500] Port 9060 was retrieved from .portInUse file
2020-09-28 10:21:56,935 P[1536] [MainThread 10500] Try to handshake on url http://localhost:9060/api/handshake...
2020-09-28 10:21:56,945 P[1536] [MainThread 10500] Request to http://localhost:9060/api/handshake
headers = {'Content-Type': 'application/json', 'x-tr-applicationid': 'xxxx'}
params = None
2020-09-28 10:21:57,091 P[1536] [MainThread 10500] Response : 200 - {"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBcGlWZXJzaW9uIjoiMSIsIkFwcEtleSI6ImU0Y2M4MWFjYmQxNTQxZjZhMWY1MmE4ZDQ5NzRmMmI5MjM4NzZjZTYiLCJBcHBTY29wZSI6InJhcGkiLCJMaWJyYXJ5TmFtZSI6IkVpa29uIFB5dGhvbiBMaWJyYXJ5IiwiTGlicmFyeVZlcnNpb24iOiIxLjEuNi5wb3N0MyIsImlhdCI6MTYwMTI4NDkxNywiZXhwIjoxNjAyNDk0NTE3fQ._tTSpU37U0pQ585CkrFnXgJ1LPU3X6OfbkB0Iwn2zEU","expires_in":1209600,"token_type":"bearer"}
2020-09-28 10:21:57,091 P[1536] [MainThread 10500] Application ID: xxxx
2020-09-28 10:21:57,092 P[1536] [MainThread 10500] Init a Desktop session with new app_key
2020-09-28 10:21:57,092 P[1536] [MainThread 10500] Port 9060 on local proxy was detected
df, err = ek.get_data("AAPL.O", ["TR.PriceClose"])
2020-09-28 10:22:03,896 P[1536] [MainThread 10500] Request:{'Entity': {'E': 'DataGrid_StandardAsync', 'W': {'requests': [{'instruments': ['AAPL.O'], 'fields': [{'name': 'TR.PriceClose'}]}]}}}
2020-09-28 10:22:03,896 P[1536] [MainThread 10500] Request to http://localhost:9060/api/v1/data
headers = {'Content-Type': 'application/json', 'x-tr-applicationid': 'xxxx', 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBcGlWZXJzaW9uIjoiMSIsIkFwcEtleSI6ImU0Y2M4MWFjYmQxNTQxZjZhMWY1MmE4ZDQ5NzRmMmI5MjM4NzZjZTYiLCJBcHBTY29wZSI6InJhcGkiLCJMaWJyYXJ5TmFtZSI6IkVpa29uIFB5dGhvbiBMaWJyYXJ5IiwiTGlicmFyeVZlcnNpb24iOiIxLjEuNi5wb3N0MyIsImlhdCI6MTYwMTI4NDkxNywiZXhwIjoxNjAyNDk0NTE3fQ._tTSpU37U0pQ585CkrFnXgJ1LPU3X6OfbkB0Iwn2zEU'}
params = None
0 -
I think that your comment was cutted because of the lenght.
Just last lines from "2020-09-28 10:22:03,896 P[1536] [MainThread 10500] Request to http://localhost:9060/api/v1/data " are the more meaningful... or are you stucked on the request without response ?
0 -
Yes I am just stuck with the request without response.
0 -
There were an issue with Python 3.8 and eikon 1.1.6 but it was fixed with last update 1.1.6.post3 (your log show that the issue disappeared, otherwise you won' have "Port 9060 on local proxy was detected" message).
Could you list all lib versions in your Python env ?
(you can get it with "pip list" command or from PyCharm/Settings/Project interpreter window)0 -
@pierre.faurelpierre.faurel
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
- 685 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
- 252 ETA
- 556 WebSocket API
- 38 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
- 652 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
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 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 中文论坛