Using Vuer in IPython/Jupyter
IPython and Jupyter notebooks have an async event loop already running, which means Vuer works seamlessly with a simple pattern.
Quick Start (IPython/Jupyter)
The recommended approach - define your app in one cell, start it in another:
Cell 1: Define your app
Cell 2: Start the server
What happens:
- Cell 2 detects IPython's event loop
- Schedules the server to start in the background
- Cell completes immediately
- Server runs in the background
- You can continue using other cells
Common Patterns
Updating the Scene Dynamically
Since the server runs in the background, you can update the scene from other cells:
Interactive Updates
For interactive updates, store the session globally:
Differences from Regular Python
| Feature | Regular Python | IPython/Jupyter |
|---|---|---|
| Event Loop | Created by Vuer | Already running (managed by IPython) |
start=True behavior | Blocks until server stops | Returns immediately, server runs in background |
| Cell execution | Script runs start-to-finish | Can run multiple cells while server runs |
| Stopping server | Ctrl+C | Restart kernel or close notebook |
Troubleshooting
RuntimeError: There is no current event loop
This error should no longer occur with the updated code. If you see it:
- Make sure you have the latest version of Vuer
- Try restarting your kernel
- Use
start=Trueinstead ofstart=False
Server doesn't respond
If the server starts but doesn't respond:
Restarting the server
To restart the server, you need to restart the kernel:
- Jupyter: Kernel → Restart
- IPython: Type
exit()and start a new session
Or use a different port: