This gist describes how you can debug a Juypter kernel written in Python with Visual Studio Code and the Python extension. Jupyter kernel code is indirectly invoked by the jupyter command line tool. Therefore, you cannot launch and debug a Jupyter kernel module directly from VS Code with a launch configuration. Instead, you need to make slight modifications to your Jupyter kernel code to allow a Python debugger to attach to it.
- Clone the Jupyter PowerShell kernel to your local machine from https://github.com/vors/jupyter-powershell.
- Ensure that you have
jupyter
anddebugpy
installed:
python -m pip install jupyter debugpy