-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Closed
Labels
Milestone
Description
Refs: #126431, microsoft/vscode-jupyter#5607
- macOS @paulacamargo25
- linux @lramos15
- windows @stuartleeks
Complexity: 4
Authors: @roblourens, @DavidKutu
Setup
- Set
"jupyter.experimental.debugging": true - Make sure that you have python 3.7 or greater installed and on your path as
python3orpython - Set up a python virtualenv (use regular python, conda is not recommended)
- In past months we had some issues with setup. If you can't get this to work, please ping me, don't struggle with it for hours
mkdir jupyter-dbg
cd jupyter-dbg
python3 -m venv ipykernel-env
- Activate the virtual environment
Mac/Linux:
source ipykernel-env/bin/activate
Windows:
ipykernel-env\Scripts\activate.bat
- Make sure you have ipykernel 6+ in the virtual environment, which has debugging support
pip install ipykernel
python3 -m ipykernel install --user
- Make sure you have the latest version of the Jupyter extension installed in VS Code Insiders
Testing
- Open a .ipynb notebook file
- Pick the kernel from your virtual env
- Click the Run by Line button in the cell toolbar, or press
F10while a cell is selected

- A debugging session should start, without the status bar changing, without the debug widget and without revealing the debug sidebar automatically
- Press the same button (or
F10) to advance to the next line, or the stop button on the left of the cell to end the session - The Variable Explorer should be shown automatically and should update after advancing each line
- Once you've stepped to the end of the cell, the session should end automatically
Test full debugging
- You should also be able to set breakpoints and use the Debug Cell command to run a cell and hit breakpoints:

More testing
- Restarting, Interrupting or changing the Kernel should end the session
- The Run by Line button shouldn't move position
- It should not step into another cell or file
- Note: the flow above is the only entrypoint. launch.json is not relevant here.
- You should never see an error that looks something like "Unable to open ..." with some tmp file path
- Clicking Run by Line on a different cell (or notebook) while a session is running should do nothing
- It shouldn't get stuck where clicking the RBL button does nothing
Known issues
- Testing run by line in an untitled notebook will ask you to save the file
- If you step over a line that calls a function in another file, it might open that file. The jupyter extension will be published with this fix tomorrow
Filing issues
File issues on the jupyter repo using the link above. Include the log from the Jupyter output channel
Reactions are currently unavailable