# Read time data stream not working in Jupyter Notebook

**URL:** <https://forum.alpaca.markets/t/read-time-data-stream-not-working-in-jupyter-notebook/11125>\
**Category:** Tutorial Requests\
**Created:** [November 21, 2022, 6:22am UTC](https://forum.alpaca.markets/t/read-time-data-stream-not-working-in-jupyter-notebook/11125 "2022-11-21T06:22:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cameron](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/cameron/32/4854_2.png) [@Cameron](https://forum.alpaca.markets/u/Cameron)\
**Post date:** [November 21, 2022, 6:22am UTC](https://forum.alpaca.markets/t/read-time-data-stream-not-working-in-jupyter-notebook/11125/1 "2022-11-21T06:22:08Z")

</div>

Hi I was just trying out the [real time quote data](https://alpaca.markets/docs/python-sdk/market_data.html#subscribing-to-real-time-quote-data) function, and it doesn’t seem to run in Jupyter Notebook (VSCode), but seems to run fine as a .py file in PyCharm.

from alpaca.data.live import CryptoDataStream  
from config import \*

wss\_client = CryptoDataStream(API\_KEY, SECRET\_KEY)

async def quote\_data\_handler(data):  
print(data)

wss\_client.subscribe\_quotes(quote\_data\_handler, “BTC/USD”)

wss\_client.run()

This returns the error “ **RuntimeError** : asyncio.run() cannot be called from a running event loop”. Does anyone know how to troubleshoot this? Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![Alpaca3000](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@Alpaca3000](https://forum.alpaca.markets/u/Alpaca3000)\
**Post date:** [September 19, 2023, 1:04pm UTC](https://forum.alpaca.markets/t/read-time-data-stream-not-working-in-jupyter-notebook/11125/2 "2023-09-19T13:04:00Z")

</div>

Hey  
I don’t have a solution, but you can run the Python script in the terminal

The notebook doesn’t work for me either

Maybe it is an issue with the websocket and the async function

Also, the notebook does not support multiprocessing sometimes

So the asyc is kind of multiprocessing stuff
