-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.ipynb debug cell -- debugger fails to hit breakpoint #15914
Comments
As a follow-up, this has hit me again. To resolve it, I created a fresh folder, created a ./.venv, opened VSCode, copied my .ipynb and .py file into this new folder, and was able to successfully use the debugger in my .ipynb.
Then I left VSCode running and went to sleep. And now first thing in the morning, it is again failing. I haven't done anything fancy. All I've been doing is tweaking a numpy-heavy .py file and an .ipynb that uses it. I haven't done anything else on my mac, other than watch a YouTube video in a Chrome tab. In fact my "fresh folder" was the folder I used for my working testcase (first screenshot). And re-executing the test now fails. On exactly the same x.ipynb file! I've looked through all available logs in Output pane, and see no anomaly. This is a serious problem :/ |
As per https://stackoverflow.com/questions/56794940/vscode-why-isnt-debugger-stopping-at-breakpoints toggling "Jupyter: Debug Just My Code" in Settings to ON has gotten it working. Why can't I see the setting I just changed in |
Than you for filling this issues and sorry you are running into this I think the final conclusion would that the settings aren’t getting saved/applied correctly. Is that correct? |
Let me clarify my last post. There's two complete separate things in it.
|
Default values aren't written into settings.json
Given that you are not debugging any 3rd party code and just a simple cell and its not hitting your break point. |
Please someone remove the info-needed tag. |
I have the same problem, the debugger does not stop. Moreover, after I stop it, the little arrow that allows me to select "Debug Cell" disappears. Tried reverting back to previous versions, both vscode-jupyter and vscode-python extensions, nothing worked. |
I've also bumped into that disappearing debug-cell option. As I remember, closing and restarting VSCode shakes it loose. I haven't been able to isolate a clean consistent minimal fail, so I haven't reported that oddity yet. There are still quite a few quirks with running .ipynbs in VSCode. I wish they had someone on the team that uses .ipynbs a lot -- they would surely bump into these frustration points. Or even a Discord where if some engineer hits such a problem, a core-dev could remote-inspect their system over screenlink. I'd be more than happy to allow a core-dev to dig around in my box if it would lead to a seamless UX. |
This is not the only issue I face. After stopping the debugger (because it does not stop) and relaunching it, I get the error "Couldn't find a debug adapter for debug type python". This started occurring after the last update of VSCode/Python extension. I tried downgrading everything, the problem persists. |
@edervishaj Did you try deleting and re-creating your Python .venv? It might be possible that it is corrupted somehow. |
I created a new environment altogether, did not help at all. The debugger stops but after the first step over it throws the above error. |
@p-i- Please can you create a separate issue for this, then we can close this.
@edervishaj Please can you create a new issue and please do share the following logs in that new issue
|
Type: Bug
TLDR (Edited 9 Aug)
In my case the problem was fixed by toggling "Jupyter: Debug Just My Code" in Settings to ON.
Original message ...
I have VSCode opened in $root. I have $root/.venv/... (Python 3.12.3, freshly installed using pyenv (macos))
I create test.ipynb
First cell:
a = 1
, Second cell:b = 2
. I execute the first cell. ok. I set a breakpoint on the first (and only) line of the second cell and debug-execute it.There's no visual indication the breakpoint has been hit. And attempting to step-{in/out/over} lands me in alien code (see screenshot).
Now I try to create a fresh test case. Quit VSCode, create test/ folder, create test/.venv/ (from pyenv, identically as done per fail-case), open VSCode in test/, create x.ipynb, 2 cells
a = 2
andb = 2
, execute the first. ok. set breakpoint on second and debug-execute the second.It hits! It works!
So something in my $root project is mashing the debugger.
This is bizarre and frustrating. It means I'm going to have to copy my entire codebase into a fresh project just to get the debugger working in .ipynb files.
Extension version: 2024.7.0
VS Code version: Code 1.92.0 (b1c0a14de1414fcdaa400695b4db1c0799bc3124, 2024-07-31T23:26:45.634Z)
OS version: Darwin arm64 23.5.0
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: