Get AI summaries of any video or article — Sign up free
Visual Debugger for Jupyter Lab/IPython Notebooks | Installation, Code Examples & Debugging thumbnail

Visual Debugger for Jupyter Lab/IPython Notebooks | Installation, Code Examples & Debugging

Venelin Valkov·
5 min read

Based on Venelin Valkov's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

Create a dedicated Conda environment (Python 3.8) before installing JupyterLab and the debugger extension.

Briefing

A new visual debugger for JupyterLab/IPython notebooks adds interactive, breakpoint-based debugging directly in the notebook UI—complete with variable inspection in table or tree views—so developers can step through code without leaving the notebook environment. The catch: it doesn’t work with the standard IPython kernel, forcing users to install and select an experimental kernel (referred to as a “sales”/“X” Python kernel) before debugging features appear.

Setup starts with creating a dedicated Conda environment pinned to Python 3.8. After activating that environment, the workflow installs core notebook tooling (including JupyterLab and the notebook package) from Conda Forge. With the environment ready, the next step is installing the JupyterLab extension for the visual debugger by pointing JupyterLab’s extension installer at the GitHub repo for the “Jupyter web debugger.” Once the extension is installed, launching the Jupyter web instance brings up the debugger panel in the interface.

In the browser UI, the debugger is enabled via a toggle. A simple demo shows how breakpoints work: after creating a list and iterating over it, the user clicks in the gutter to set a breakpoint, runs the cell, and then watches execution pause at the marked line. While stopped, variables appear in a dedicated “variables” area. Toggling the view formats those variables into a more readable table, and a tree view option helps inspect nested structures. From there, execution can be continued or stepped through line by line, with the debugger updating values such as the loop variable as it advances through the list.

A more practical example demonstrates debugging during data filtering. The notebook defines a contrived list of YouTube creators—some labeled with “Dr.” in their names—and assigns each creator a subscriber count. The code builds a dictionary of “doctors” by iterating through names and subscriber counts and using string matching: if a name contains “doctor,” the entry is added to the doctors dictionary. Breakpoints placed inside the loop let the user observe the control flow in real time: the debugger halts at the conditional, shows when the doctors dictionary is empty at the start, and then reveals it growing as qualifying “Dr.” entries are encountered. Stepping through successive iterations makes it clear which creators match the condition and which do not.

Finally, the notebook computes aggregate metrics: it sums the subscriber counts stored in the doctors dictionary, calculates the total subscribers across all creators, and derives the fraction of subscribers belonging to the “doctors” subset. Using the debugger’s variable inspection at intermediate steps, the fraction comes out to roughly 13.1%. The overall takeaway is straightforward: once the extension and experimental kernel are in place, the visual debugger turns notebook execution into an interactive, inspectable process—breakpoints, stepping, and structured variable views included—making it easier to validate logic and catch mistakes during development.

Cornell Notes

The visual debugger for JupyterLab/IPython notebooks brings interactive debugging into the notebook UI, including breakpoints, step-through execution, and variable inspection. Installation requires a dedicated Conda environment (Python 3.8) and adding the JupyterLab extension from the debugger’s GitHub repository. A key limitation is that it doesn’t work with the standard IPython kernel, so users must install and select an experimental kernel (referred to as “sales”/“X Python”). In practice, breakpoints pause execution inside loops, and variables can be viewed as tables or in a tree structure while stepping through conditions and computations. A contrived “YouTube favorites” example shows filtering “Dr.”-named creators into a dictionary and computing that subset’s subscriber share (~13.1%).

Why does the visual debugger require an experimental kernel instead of the standard IPython kernel?

The debugger has a current compatibility limitation: it doesn’t work with the standard IPython kernel. To use it, the setup includes installing a separate kernel (described as an experimental “sales”/“X Python” kernel, associated with Microsoft) and then selecting that kernel in the JupyterLab interface. Without switching kernels, the debugger UI won’t function as intended.

What are the core installation steps to get the debugger working in JupyterLab?

First, create a new Conda environment with Python 3.8 and activate it. Then install notebook-related packages—specifically the notebook package and JupyterLab—using Conda Forge. Next, install the debugger as a JupyterLab extension by running a command like “jupyter labextension install” pointing to the debugger’s GitHub repo. After that, start the Jupyter web instance and confirm the debugger panel appears in the UI.

How does breakpoint-based debugging work in the notebook UI?

After enabling the debugger toggle in the interface, set a breakpoint by clicking the breakpoint point in the code gutter. When the cell runs, execution pauses at that line. While paused, the variables panel shows current values; stepping or continuing updates the state as the program moves forward. In the demo list-iteration example, the loop variable changes (e.g., i becomes 1, then 2, etc.) as stepping proceeds.

What variable inspection features help during debugging?

The debugger provides a variables area that can switch between a table view and a tree view. This makes it easier to read variable contents and inspect nested structures. In the examples, toggling the view makes the variable display more readable, and stepping through code shows how dictionaries and intermediate computations evolve.

How was the debugger used to validate a filtering condition?

The notebook filters creators into a “doctors” dictionary using string matching: if a creator’s name contains “doctor,” the name and subscriber count are added to the dictionary. Breakpoints inside the loop let the user observe the conditional being evaluated each iteration. The doctors dictionary starts empty, then grows when “Dr.”-labeled names are encountered, and remains unchanged for non-matching names.

How were aggregate results computed and checked with the debugger?

After building the doctors dictionary, the notebook sums the subscriber counts stored in it to get doctor subscribers. It also computes total subscribers across all creators. The fraction is then calculated as doctor_subs divided by total_subs (using an expression like doctor_subs / all_subs). With breakpoints and variable inspection at intermediate steps, the fraction is reported as roughly 13.1%.

Review Questions

  1. What specific kernel compatibility issue affects the visual debugger, and what workaround is required?
  2. Walk through how you would set a breakpoint and use stepping to confirm a conditional inside a loop.
  3. In the contrived “YouTube favorites” example, what computations produce the ~13.1% fraction, and where would you place breakpoints to verify them?

Key Points

  1. 1

    Create a dedicated Conda environment (Python 3.8) before installing JupyterLab and the debugger extension.

  2. 2

    Install the visual debugger as a JupyterLab extension using the debugger’s GitHub repo as the source.

  3. 3

    Switch to the experimental kernel (referred to as “sales”/“X Python”) because the debugger doesn’t work with the standard IPython kernel.

  4. 4

    Enable the debugger toggle in the JupyterLab UI to activate breakpoint-based controls.

  5. 5

    Use breakpoints in the gutter to pause execution and inspect variables while stepping through code.

  6. 6

    Leverage variable views (table and tree) to track how dictionaries and intermediate values change across iterations.

  7. 7

    Validate logic by stepping through conditional branches and then checking aggregate computations like sums and fractions.

Highlights

The debugger’s biggest constraint is kernel compatibility: it won’t run with the standard IPython kernel, so selecting an experimental kernel is mandatory.
Breakpoints pause notebook execution, and variable inspection updates live as execution steps forward—turning notebook runs into an interactive debugging session.
Variable inspection can switch between table and tree views, making it easier to understand both flat values and nested structures.
A filtering example shows how stepping through a string-matching condition reveals exactly when the “doctors” dictionary grows.
The contrived dataset yields a doctor-subscriber share of roughly 13.1%, computed from dictionary sums divided by total subscribers.

Topics

  • JupyterLab Debugging
  • Conda Installation
  • JupyterLab Extension
  • Breakpoints
  • Kernel Compatibility