Skip to content

Test: Debug Cell in Jupyter notebooks #133905

@DavidKutu

Description

@DavidKutu

Refs: microsoft/vscode-jupyter#1652

Complexity: 3

Authors: @roblourens, @DavidKutu

Create Issue

Create Issue


Setup

  • Use VS Code Insiders and the latest jupyter and python extensions
  • Make sure that you have python 3.7 or greater installed and on your path as python3 or python
  • Set up a python virtualenv:
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
  • Install the latest version of ipykernel in the virtual environment, which has debugging support
pip install ipykernel --pre
python3 -m ipykernel install --user
  • Open a .ipynb notebook file (You can use this one if you need one)
  • Pick the kernel from your virtual env
  • Set "jupyter.logging.level": "verbose"

Testing

  • Set a breakpoint on the cell you want to test
  • Click Debug Cell under the Run button, you should hit the breakpoint and start a normal debugging session
    image
  • Try stepping into other cells, other python files, and other python packages as usual
  • Finishing the cell should stop debugging
  • Interrupting or Restarting the kernel should also stop Debugging
  • While debugging, the run by line button should be disabled
  • You should never get a temp file opened that reads: Could not load source ...

More Testing

  • Check on the panel, that Jupyter: Variables gets updated after each step

Filing issues

File issues on the jupyter repo using the link above. Include the log from the Jupyter output channel

Known Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions