Visual Debugger for Jupyter Lab/IPython Notebooks | Installation, Code Examples & Debugging
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.
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?
What are the core installation steps to get the debugger working in JupyterLab?
How does breakpoint-based debugging work in the notebook UI?
What variable inspection features help during debugging?
How was the debugger used to validate a filtering condition?
How were aggregate results computed and checked with the debugger?
Review Questions
- What specific kernel compatibility issue affects the visual debugger, and what workaround is required?
- Walk through how you would set a breakpoint and use stepping to confirm a conditional inside a loop.
- 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
Create a dedicated Conda environment (Python 3.8) before installing JupyterLab and the debugger extension.
- 2
Install the visual debugger as a JupyterLab extension using the debugger’s GitHub repo as the source.
- 3
Switch to the experimental kernel (referred to as “sales”/“X Python”) because the debugger doesn’t work with the standard IPython kernel.
- 4
Enable the debugger toggle in the JupyterLab UI to activate breakpoint-based controls.
- 5
Use breakpoints in the gutter to pause execution and inspect variables while stepping through code.
- 6
Leverage variable views (table and tree) to track how dictionaries and intermediate values change across iterations.
- 7
Validate logic by stepping through conditional branches and then checking aggregate computations like sums and fractions.