Skip to content

Debugging a cell does not work after running line by line #15975

@olguzzar

Description

@olguzzar

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

  1. Run a cell line by line. Run through the entire cell using the "Run Next Line" action, until you reach the end of the cell.
  2. Try to debug the cell. Expected behavior is that the cell will properly debug and hit the set breakpoint. Actual behavior is that the cell does not debug, and I no longer have the option to debug the cell or run it line by line.

The below video shows the error. Note that debugging works fine at first, after running a cell line by line using the "Continue execution". However, after I run the cell line by line and run through the entire cell just using the "Run Next Line", debugging no longer works after (and I can't try running the cell line by line either, as that option is greyed out)

jupyter.debug.mp4

VS Code Version

Version: 1.92.2 (user setup) Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9 Date: 2024-08-14T17:29:30.058Z Electron: 30.1.2 ElectronBuildId: 9870757 Chromium: 124.0.6367.243 Node.js: 20.14.0 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.22621

Jupyter Extension Version

v2024.7.0

Jupyter logs

Visual Studio Code (1.92.2, undefined, desktop)
Jupyter Extension Version: 2024.7.0.
Python Extension Version: 2024.12.3.
Pylance Extension Version: 2024.8.2.
Platform: win32 (x64).
Workspace folder ~\projects\jupyter-notebooks, Home = c:\Users\olguzzar
14:58:03.236 [info] Starting Kernel (Python Path: ~\AppData\Local\anaconda3\python.exe, Conda, 3.12.4) for '~\projects\jupyter-notebooks\MyFirstNotebook.ipynb' (disableUI=true)
14:58:24.431 [warn] The following kernels use interpreters that are no longer valid or not recognized by Python extension, Kernels startUsingPythonInterpreter:'id=.jvsc74a57bd02a8dfe095fce2b5e88c64a2c3ee084c8e0e0d70b23e7b95b1cfb538be294c5c8.c:\msys64\mingw64\bin\python.exe.c:\msys64\mingw64\bin\python.exe.-m#ipykernel_launcher'(interpreterId='c:\MSYS64\MINGW64\BIN\PYTHON.EXE') and valid interpreter ids include C:\PYTHON310\PYTHON.EXE, C:\USERS\~\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON39\PYTHON.EXE, C:\USERS\~\APPDATA\LOCAL\ANACONDA3\PYTHON.EXE, C:\USERS\~\PROJECTS\JUPYTER-NOTEBOOKS\.VENV\SCRIPTS\PYTHON.EXE, C:\USERS\~\PROJECTS\JUPYTER-NOTEBOOKS\VENV\SCRIPTS\PYTHON.EXE, C:\MSYS64\MINGW64\BIN\PYTHON3.EXE
14:58:24.512 [warn] The following kernels use interpreters that are no longer valid or not recognized by Python extension, Kernels startUsingPythonInterpreter:'id=.jvsc74a57bd0233e75713664bf2047f8aadc31c5dc715137b2e2f904d1a281b6323577e22342.c:\msys64\mingw64\bin\python3.exe.c:\msys64\mingw64\bin\python3.exe.-m#ipykernel_launcher'(interpreterId='c:\MSYS64\MINGW64\BIN\PYTHON3.EXE') and valid interpreter ids include C:\PYTHON310\PYTHON.EXE, C:\USERS\~\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON39\PYTHON.EXE, C:\USERS\~\APPDATA\LOCAL\ANACONDA3\PYTHON.EXE, C:\USERS\~\PROJECTS\JUPYTER-NOTEBOOKS\.VENV\SCRIPTS\PYTHON.EXE, C:\USERS\~\PROJECTS\JUPYTER-NOTEBOOKS\VENV\SCRIPTS\PYTHON.EXE, C:\MSYS64\MINGW64\BIN\PYTHON3.9.EXE
14:58:25.361 [info] Starting debugging with mode 0
14:58:35.375 [info] Process Execution: ~\AppData\Local\anaconda3\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
14:58:35.430 [info] Process Execution: ~\AppData\Local\anaconda3\python.exe c:\Users\~\.vscode\extensions\ms-toolsai.jupyter-2024.7.0-win32-x64\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 36548
    > cwd: ~\.vscode\extensions\ms-toolsai.jupyter-2024.7.0-win32-x64\pythonFiles\vscode_datascience_helpers
14:58:35.658 [info] Process Execution: ~\AppData\Local\anaconda3\python.exe -m pip list
14:58:36.283 [info] Process Execution: ~\AppData\Local\anaconda3\python.exe -m ipykernel_launcher --f=c:\Users\~\AppData\Roaming\jupyter\runtime\kernel-v2-36548lpWzutlWvTtK.json
    > cwd: ~\projects\jupyter-notebooks
14:58:46.272 [info] Kernel successfully started
14:58:46.326 [info] Process Execution: ~\AppData\Local\anaconda3\python.exe c:\Users\~\.vscode\extensions\ms-toolsai.jupyter-2024.7.0-win32-x64\pythonFiles\printJupyterDataDir.py
14:58:53.806 [info] Ending debug session 811f9361-f5a0-49b8-a9e4-b38a9c982e08
14:58:53.807 [info] Ending debug session 811f9361-f5a0-49b8-a9e4-b38a9c982e08
14:59:01.602 [info] Ending debug session 811f9361-f5a0-49b8-a9e4-b38a9c982e08
14:59:06.375 [info] Starting debugging with mode 1
14:59:10.767 [info] Ending debug session 240790e7-bd5b-4936-8a8a-b29886aa934c
14:59:12.758 [info] Ending debug session 240790e7-bd5b-4936-8a8a-b29886aa934c
14:59:12.758 [info] Ending debug session 240790e7-bd5b-4936-8a8a-b29886aa934c
14:59:13.931 [info] Starting debugging with mode 0
14:59:20.962 [info] Ending debug session 34031eb4-a398-426f-b679-93fc4acde340
14:59:22.970 [info] Ending debug session 34031eb4-a398-426f-b679-93fc4acde340
14:59:22.970 [info] Ending debug session 34031eb4-a398-426f-b679-93fc4acde340
14:59:25.341 [info] Starting debugging with mode 1

Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

conda 24.5.0

Running Jupyter locally or remotely?

None

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugnotebook-debugging

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions