Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 1

Streaming Prices | Error "coroutine 'StreamingPrice.open_async' was never awaited"?

Installed fresh python 3.11 / fresh eikon and getting below error and can't for the life of me solve it.


Code is simple streaming price pull :

sp = ek.StreamingPrices(instruments=["LCOc1"], fields=['CF_LAST'])
sp.open()


Important bit of error is:

await asyncio.wait(task_list, return_when=asyncio.ALL_COMPLETED)

File "C:\Users\x\.conda\envs\x\Lib\asyncio\tasks.py", line 415, in wait

raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")

TypeError: Passing coroutines is forbidden, use tasks explicitly.

sys:1: RuntimeWarning: coroutine 'StreamingPrice.open_async' was never awaited

eikoneikon-data-api#technology#productstreaming-pricesasynchronous
icon clock
10 |1500

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

1 Answer

· Write an Answer
Upvotes
Accepted
81.1k 264 53 76

@andrej.kovacic

Thank you for reaching out to us.

Python 11 may change its implementation because the code runs fine on Python 10. I will contact the development team to verify this problem.

For now, you can try the Refinitiv Data Library for Python instead (https://pypi.org/project/refinitiv-data/).

The following code runs fine on Python 11.

import refinitiv.data as rd
import os
os.environ["RD_LIB_CONFIG_PATH"] = "./"


rd.open_session('desktop.workspace')


stream = rd.open_pricing_stream(
    universe=['/LCOc1'],
    fields=['CF_LAST']
)
print(stream.get_snapshot())

1694427278821.png

You can check the example code on GitHub.


1694427278821.png (6.4 KiB)
icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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