Voila
Voila turns Jupyter notebooks into standalone web applications. It executes the notebook and renders the output, displaying interactive widgets and outputs without the underlying code. The current version is 0.5.11, with frequent patch releases addressing bug fixes and minor enhancements, typically on a bi-weekly or monthly cadence.
Common errors
-
Jupyter command 'voila' not found.
cause Voila is not installed, or its executable entry point is not in the system's PATH, or the active Python environment does not have Voila installed.fixEnsure Voila is installed in your active environment (`pip install voila` or `conda install -c conda-forge voila`). Verify that the environment's `bin` (Linux/macOS) or `Scripts` (Windows) directory is correctly added to your system's PATH. -
ModuleNotFoundError: No module named 'voila'
cause The `voila` Python package is not installed in the currently active Python environment.fixInstall the package using your package manager: `pip install voila` or `conda install -c conda-forge voila`. -
Error displaying widget: model not found
cause This typically indicates a mismatch between the `ipywidgets` version in your notebook and the frontend assets available to Voila, or a missing JupyterLab extension for a custom widget.fixEnsure `ipywidgets` is up-to-date (`pip install -U ipywidgets`). For custom widgets, verify that necessary JupyterLab extensions are installed and built (`jupyter labextension install <package>`). Sometimes, a browser cache clear is also helpful. -
voila: error: argument --enable_nbextensions: invalid choice: 'True'
cause This error occurs when using a command-line argument or configuration option that has been removed or renamed in a newer version of Voila (e.g., `--enable_nbextensions` was removed in Voila 0.5.x).fixConsult the official Voila documentation or the `--help` output of your specific Voila version (`voila --help`) to identify valid command-line arguments and remove or update any deprecated options.
Warnings
- breaking Earlier versions of Voila (e.g., prior to 0.4.5 and 0.5.8) had reduced compatibility with `ipywidgets 7`, potentially causing existing notebooks to fail if they relied on older widget versions. Newer releases re-added support.
- gotcha Some Voila templates or custom JupyterLab extensions (e.g., for specific widget packages) may require `nodejs` and `npm` to be installed on your system for building frontend assets. These are not direct Python dependencies.
- gotcha Multiple older versions contained a security vulnerability (CVE-2024-30265) related to arbitrary file read. Running outdated versions in production environments is risky.
- gotcha Versions of Voila in the 0.5.x series (e.g., 0.5.9, 0.5.10, 0.5.11) included fixes for server extension configuration handling. Users with complex custom `voila_config.py` files might experience unexpected behavior with older 0.5.x releases.
Install
-
pip install voila -
conda install -c conda-forge voila
Imports
- Voila
from voila.app import Voila
Quickstart
# Save this as `my_dashboard.ipynb`
import ipywidgets as widgets
from IPython.display import display
slider = widgets.IntSlider(min=0, max=100, step=1, description='Value:')
output = widgets.Output()
def on_value_change(change):
with output:
output.clear_output()
print(f"Slider value is: {change['new']}")
slider.observe(on_value_change, names='value')
display(slider, output)
# Run from your terminal:
# voila my_dashboard.ipynb