Can Jupyter debugger step into module code (with IPython kernel)?

I’m playing with JupyterLab’s built-in debugger for the first time, pretty slick. However, I’m having trouble getting it to step into code that isn’t local to the notebook (like methods of third-party libraries). Searching for help online, I find a series of issues/PRs that seem related. The most recent one is still open after two years, and seems to say that this support was merged and then reverted.

These resources are all written from a development-oriented perspective, and from a user perspective I’m still not sure whether this support ever landed. The issue still being open implies no, but the user documentation doesn’t mention this limitation so I thought I’d double-check here.

Does Jupyter’s debugger support stepping into code that is outside the notebook?

1 Like

However, I’m having trouble getting it to step into code that isn’t local to the notebook

I think it depends what you mean by this. Can you provide a specific example using a specific (but popuplar library)?

1 Like

In my case, I encountered this because I was curious to know which arguments statsmodels passes through to patsy.

In the above example, I set a breakpoint on the last line. I’m able to step into my_function, but I’m not able to step any deeper (into smf.ols). Code from the screenshot:

import pandas as pd
import statsmodels.formula.api as smf


def my_function(df):
    mod = smf.ols("y ~ x", data=df)


df = pd.DataFrame(dict(y=[0, 1], x=[2, 4]))
my_function(df)

Relevant versions:

Python 3.11.2
pandas==2.2.1
statsmodels==0.14.1
ipykernel==6.29.3
ipython==8.22.1
jupyterlab==4.1.2

Hope this helps to narrow it down!

I am also in need of debugging into a module. Is this possible?