You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues to ensure there isn't already an issue about this question.
My question has to do with the Python SDK and isn't a general question about the API. (If it is please open your issue here)
My question isn't about how to do a specific algorithm or asking for trade advice (answers to these are outside the scope of this repo).
Question
Hello,
I am new to the Alpaca API, thank you for making this resource available.
I have started with the examples in the documentation (ReadMe.md). I had no issues with the REST API to retrieve historical data. However, I can't run the example under Live Stream Market Data. Everything seems fine until I get to the command:
stream.run()
When I execute it, I get the error:
Traceback (most recent call last):
Input In [12] in <cell line: 1>
stream.run()
File ~/opt/anaconda3/envs/trade/lib/python3.8/site-packages/alpaca_trade_api/stream.py:1005 in run
asyncio.run(self._run_forever())
File ~/opt/anaconda3/envs/trade/lib/python3.8/asyncio/runners.py:33 in run
raise RuntimeError(
RuntimeError: asyncio.run() cannot be called from a running event loop
Any guidance is much appreciated
Thanks!
The text was updated successfully, but these errors were encountered:
In case anyone encounters this problem, the issue I had was due to incompatibility between asyncio and my IDK (spyder). I switched to pycharm, seems to work fine
Question form pre-submit checklist.
Question
Hello,
I am new to the Alpaca API, thank you for making this resource available.
I have started with the examples in the documentation (ReadMe.md). I had no issues with the REST API to retrieve historical data. However, I can't run the example under Live Stream Market Data. Everything seems fine until I get to the command:
stream.run()
When I execute it, I get the error:
Traceback (most recent call last):
Input In [12] in <cell line: 1>
stream.run()
File ~/opt/anaconda3/envs/trade/lib/python3.8/site-packages/alpaca_trade_api/stream.py:1005 in run
asyncio.run(self._run_forever())
File ~/opt/anaconda3/envs/trade/lib/python3.8/asyncio/runners.py:33 in run
raise RuntimeError(
RuntimeError: asyncio.run() cannot be called from a running event loop
Any guidance is much appreciated
Thanks!
The text was updated successfully, but these errors were encountered: