Overview
JupyterLab 3.0, released on January 8, 2021, adds a built-in visual debugger, automatic table of contents, and a new pip-based extension API.
Main Features
Visual debugger
JupyterLab now includes a visual debugger that lets you set breakpoints, inspect variables, and navigate the call stack directly from the notebook interface.
python
# The debugger can be enabled from the toolbar
# It requires a compatible kernel (ipykernel >= 6.0)
# Example code to debug in JupyterLab 3
def compute_statistics(data):
total = sum(data) # <- set a breakpoint here
mean = total / len(data)
deviations = [(x - mean) ** 2 for x in data]
variance = sum(deviations) / len(data)
return {'mean': mean, 'variance': variance}
# Run with the debugger enabled to inspect
# each variable at every step
result = compute_statistics([4, 8, 15, 16, 23, 42])
print(result)
Table of contents and new extension API
The table of contents (ToC) is now built in and generates automatically from Markdown headings. Extensions can now be installed via pip install without requiring Node.js, greatly simplifying the ecosystem.
python
# Simplified extension installation (no Node.js needed)
# pip install jupyterlab-git
# pip install jupyterlab-lsp
# The ToC is generated from Markdown headings:
# # Main title -> level 1
# ## Data analysis -> level 2
# ### Data cleaning -> level 3
# Pre-compiled extension API
# Create a JupyterLab 3 extension:
# pip install cookiecutter
# cookiecutter https://github.com/jupyterlab/extension-cookiecutter-ts
