Skip to content

Support debugging Jupyter notebook cells #3906

Open
@coatless

Description

Positron Version:

Steps to reproduce the issue:

  1. Open a new Jupyter Notebook for Python
  2. Create the subtract function and its call inside of a cell
def subtract(a, b):
    diff = a - b
    return diff

subtract(1, 2)
  1. Click on the left of diff line to insert a breakpoint
  2. Try running the debugger
  3. Attempt to advance the line
  4. Receive error in Terminal

Debugger open in Notebook with breakpoint

A screenshot of the Positron IDE with the debugger for Python open alongside of a Jupyter Notebook; however, the debugger does not have any call stack information present.

Debugger options

A screenshot of the Positron IDE with the debugger for Python options being present in the command palette, an error in the terminal of `null`, and a red debug dot active

What did you expect to happen?

The Python debugger should have displayed the call stack

Were there any error messages in the output or Developer Tools console?

(ds) (base) ➜  Positron-Python  cd /Users/ronin/PositronVideos/Positron-Python ; /usr/bin/env /opt/
miniconda3/envs/ds/bin/python /Users/ronin/.positron/extensions/ms-python.debugpy-2024.6.0-darwin-a
rm64/bundled/libs/debugpy/adapter/../../debugpy/launcher 52971 -- /Users/ronin/PositronVideos/Posit
ron-Python/jupyter-debugger-demo.ipynb 
Traceback (most recent call last):
  File "/opt/miniconda3/envs/ds/lib/python3.12/runpy.py", line 198, in _run_module_as_main
    return _run_code(code, main_globals, None,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/ds/lib/python3.12/runpy.py", line 88, in _run_code
    exec(code, run_globals)
  File "/Users/ronin/.positron/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
    cli.main()
  File "/Users/ronin/.positron/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
    run()
  File "/Users/ronin/.positron/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
    runpy.run_path(target, run_name="__main__")
  File "/Users/ronin/.positron/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
    return _run_module_code(code, init_globals, run_name,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ronin/.positron/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Users/ronin/.positron/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
    exec(code, run_globals)
  File "/Users/ronin/PositronVideos/Positron-Python/jupyter-debugger-demo.ipynb", line 14, in <module>
    "execution_count": null,
                       ^^^^
NameError: name 'null' is not defined

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: debuggerIssues related to Debuggingarea: notebooksIssues related to Notebooks category.enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions