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

**URL:** <https://discourse.jupyter.org/t/can-jupyter-debugger-step-into-module-code-with-ipython-kernel/24268>\
**Category:** JupyterLab\
**Tags:** jupyterlab\
**Created:** [March 4, 2024, 8:41pm UTC](https://discourse.jupyter.org/t/can-jupyter-debugger-step-into-module-code-with-ipython-kernel/24268 "2024-03-04T20:41:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkb](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/tkb/32/12567_2.png) [@tkb](https://discourse.jupyter.org/u/tkb)\
**Post date:** [March 4, 2024, 8:41pm UTC](https://discourse.jupyter.org/t/can-jupyter-debugger-step-into-module-code-with-ipython-kernel/24268/1 "2024-03-04T20:41:27Z")

</div>

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](https://github.com/ipython/ipykernel/issues/854) 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](https://jupyterlab.readthedocs.io/en/latest/user/debugger.html) 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?

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [March 5, 2024, 12:02am UTC](https://discourse.jupyter.org/t/can-jupyter-debugger-step-into-module-code-with-ipython-kernel/24268/2 "2024-03-05T00:02:14Z")

</div>

> 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)?

---

<div class="post-metadata">

**Author:** ![tkb](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/tkb/32/12567_2.png) [@tkb](https://discourse.jupyter.org/u/tkb)\
**Post date:** [March 5, 2024, 8:37pm UTC](https://discourse.jupyter.org/t/can-jupyter-debugger-step-into-module-code-with-ipython-kernel/24268/3 "2024-03-05T20:37:24Z")

</div>

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

 ![Screenshot 2024-03-05 at 12.21.55](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/6/6de2f1ef7d1e5627de76eb0393d70a5306e08c80.png)

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:

```python
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:

```auto
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!

---

<div class="post-metadata">

**Author:** ![matt](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/matt/32/4710_2.png) [@matt](https://discourse.jupyter.org/u/matt)\
**Post date:** [April 18, 2024, 5:57pm UTC](https://discourse.jupyter.org/t/can-jupyter-debugger-step-into-module-code-with-ipython-kernel/24268/4 "2024-04-18T17:57:52Z")

</div>

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