theOehrly / Fast-F1

FastF1 is a python package for accessing and analyzing Formula 1 results, schedules, timing data and telemetry
https://docs.fastf1.dev
MIT License
2.46k stars 259 forks source link

BUG: SignalRClient cannot be used inside Jupyter Notebook #521

Closed theOehrly closed 4 months ago

theOehrly commented 7 months ago

Modern versions of Jupyter (IPython >= 7.0) cannot run an asyncio event loop by default.

This causes the following simple example to fail

from fastf1.livetiming.client import SignalRClient

SignalRClient(filename='output.txt').start()

This is caused by the fact that .start() calls asyncio.run() which cannot be called from within a running event loop.

Discussed in https://github.com/theOehrly/Fast-F1/discussions/520

Originally posted by **Ivan-Keli** February 11, 2024 ### Using the Fast-F1 signalr client? I got this error while trying to demonstrates the usage of the SignalRClient. Could you guys help me fix it Example Fast F1