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
{{ message }}
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
There is a whole thread of people trying to get ib_insync to work within Streamlit without success. Error is 'There is no current event loop.' streamlit/streamlit#744
Maybe we can get a code recipe for doing this in the ib_insync docs? (hopefully it's this simple)
The text was updated successfully, but these errors were encountered:
import asyncio
def get_or_create_eventloop():
try:
return asyncio.get_event_loop()
except RuntimeError as ex:
if "There is no current event loop in thread" in str(ex):
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
return asyncio.get_event_loop()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
There is a whole thread of people trying to get ib_insync to work within Streamlit without success. Error is 'There is no current event loop.'
streamlit/streamlit#744
Maybe we can get a code recipe for doing this in the ib_insync docs? (hopefully it's this simple)
The text was updated successfully, but these errors were encountered: