ipylab is a Python library that allows direct control and interaction with the JupyterLab environment from within Python notebooks. It provides programmatic access to JupyterLab's features, enabling users to add widgets to the main area, build complex interfaces using Lumino widgets, launch arbitrary commands, and listen to JupyterLab signals to trigger Python callbacks. The library is currently at version 1.1.0 and is actively maintained with a focus on compatibility with recent JupyterLab and ipywidgets versions.
pip install ipylabVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to instantiate the JupyterFrontEnd application object and use it to execute a JupyterLab command. A button is created using `ipywidgets`, which, when clicked, triggers the 'notebook:run-all-below' command in the active JupyterLab notebook.
Ensure your JupyterLab installation is updated to version 4.x. Review the `ipylab` and JupyterLab documentation for specific migration guides if you encounter issues.
Upgrade `ipywidgets` to version 8.x in your environment. Consult the `ipywidgets` migration guide for details on adapting custom widgets or older code.
Ensure your Python environment is running Python 3.8 or newer. Update your environment or create a new one with a supported Python version.
Test your `ipylab` and `ipywidgets` usage across different JupyterLab/Notebook versions. For interactive widgets, you might need to use `IPython.display.display(IFrame(...))` with embedded HTML for consistent behavior, as described in `ipywidgets` documentation.
Always install `ipylab` within the same `conda` or `pip` environment as your JupyterLab and `ipywidgets` installation. Ensure all packages are up-to-date or compatible according to their release notes. A fresh environment setup often resolves these issues.
Ensure that `jupyterlab` and `ipylab` (and `ipywidgets`) are installed in the same environment. If installed via `pip`, JupyterLab usually handles the frontend extension automatically, but sometimes a manual `jupyter lab build` or `jupyter labextension install @jupyter-widgets/jupyterlab-manager` might be needed for older JupyterLab versions or specific setups. Restart JupyterLab after installation.
Verify that your `ipywidgets` version is compatible with your JupyterLab version (e.g., `ipywidgets` 8.x for JupyterLab 4.x). Ensure `jupyterlab_widgets` is installed. Try `pip install --upgrade jupyterlab ipywidgets` and then `jupyter lab build` to refresh the frontend assets. Restart your JupyterLab server.
Ensure that the directory containing the `jupyter` executable (often `~/.local/bin` for pip user installs or `<conda_env_path>/bin/` for conda) is included in your system's PATH. Alternatively, you can explicitly call the executable by its full path, e.g., `~/.local/bin/jupyter lab`.