jupyter / jupyter/notebook

pdb, environment setup, and addition of "breakpoint" in .ipynb file(s)

Open
#7,585 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

## Description

Screenshot of the "User variables for Kevin" environment setting 'pythonbreakpoint' all caps, value is 'pdb.set_trace'!
![Image](https://github.com/user-attachments/assets/c114fbcc-f07f-42b4-870c-a947bb8f4bac)
Having done as suggested to be able to set 'breakpoint() in my .ipynb script! Execution of the script did not result in a halt, & entry into "ipdb>".

## Reproduce

1) Edit the 'user variables of kevin in Environment Variables window
2) Add 'PYTHONBREAKPOINT' to the 'Variable' section, next add to the 'Value' side, the string in single quotes, 'pdb.set_trace' statement.
3) Add the string no quotes [breakpoint()]
4) From the Jupyter Notebook, run the script that contains the above "3)" step.
5) Observe output.

## Python.org:


(https://docs.python.org/3/using/cmdline.html#envvar-PYTHONBREAKPOINT)
Consulted the 'python.org' site for the proper syntax of the use of 'PDB'!

## Expected behavior

title="I'm a tooltip">My lines in the script Tic Tac Toe.


from IPython.display import clear_output


import pdb;


import sys;


from IPython import embed


import os


os.environ['PYTHONBREAKPOINT'] = 'pdb.set_trace'


# DEBUGGING environment variables for kevin...


print(os.getenv('PYTHONBREAKPOINT'))


Well, I expected execution to halt when the script reached and executed "breakpoint()" in my script!


def game_message():

message_string = "\nThis is the Tic-Tac-Toe game, & you will\
see the standard board (above) layout of\
three rows, with three boxes per row! On\
the game board (below) top-left box is\
'1' and the bottom-right box is '9', and please,\
only Capital X or O.\n\
\nYou will select a box number to place your X or O into!\n\
'X' is player1, and 'O' is player2!\n"

print(message_string)
breakpoint()

breakpoint() I expected this: "ipdb>", didn't happen!


# game_message()
# END game_message()

def display_game_board():

gameOn = True
breakpoint()

breakpoint() I expected this: "ipdb>", didn't happen!


## Context

Windows 11, 24H2


Chrome version 133.0.6943.60 (Official Build) (64-bit)


Jupyter Notebook Version: 7.0.8

Troubleshoot Output

Paste the output from running `jupyter troubleshoot` from the command line here.

You may want to sanitize the paths in the output.

Command Line Output

Paste the output from your command line running `jupyter notebook` here, use `--debug` if possible.

Browser Output

Failed to load resource: the server responded with a status of 404 Pierian_Data_Logo.png:1           

(Not Found)Understand this errorAI
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'type') 4234.bundle.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'type')
at _e (4234.bundle.js:1:109624)
at 4234.bundle.js:1:108043
at Array.forEach ()
at l (4234.bundle.js:1:108002)
at c (4234.bundle.js:1:109100)
at a (409.bundle.js:1:2625)
at e.emit (409.bundle.js:1:2354)
at o.emit (409.bundle.js:1:334)
at ce._onCellInViewportChanged (4234.bundle.js:1:66622)
at a (409.bundle.js:1:2625)Understand this errorAI
523.fa256ee012d38a89b65a.js:1 Uncaught (in promise) TypeError: e.metadata.get is not a function
at x._loadFromNotebook (523.fa256ee012d38a89b65a.js:1:5542)
at x.restoreWidgets (523.fa256ee012d38a89b65a.js:1:4202)Understand this errorAI
202-Milestone%20Proje…%20Workbook.ipynb:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was receivedUnderstand this errorAI

Contributor guide

Open the contributing guide

Research direction

Start by running the supplied .ipynb example with breakpoint() through the jupyter notebook command, checking PYTHONBREAKPOINT and the reported browser errors. Compare the observed execution with the expected ipdb> prompt and use jupyter troubleshoot output to determine whether the issue is in notebook execution or environment setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
backend, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.