You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Breakpoints in an external .py file works when a Kernel is freshly started, but any change to the py file breaks behavior #2036
def my_external_loop():
for x in range(10):
print(x)
print("nroks")
print("hello wurld")
def some_other_function():
print("Guess who's coming to gorlack?")
When running 'debug cell' a breakpoint set in the .py file is hit as expected. Any change to the .py file causes the breakpoint no longer to be hit and if I instead break inside the jupyter cell (which still works) and enter into the external code by line-stepping via F11, the line execution is displayed as occuring at the top of the file, as opposed inside either of the functions.
Sorry but this is by design. The file has been modified so it doesn't match. You have to restart the kernel in order to reload the file into the process.
Although I thought we indicated this to VS code by saying the source doesn't match.
Well anyway, there's no way for this to work because the file has changed and you need to reload it into the kernel. The kernel is still using the old file.
A shame. It'd be wonderful to not have to restart the kernel each time as modifying external .py files while building in/around a Jupyter file is super useful.
Regardless, I much appreciate you taking the time to confirm this behavior is 'as intended'.
Activity
rchiodo commentedon Jun 15, 2026
Sorry but this is by design. The file has been modified so it doesn't match. You have to restart the kernel in order to reload the file into the process.
Although I thought we indicated this to VS code by saying the source doesn't match.
Well anyway, there's no way for this to work because the file has changed and you need to reload it into the kernel. The kernel is still using the old file.
Gazoo101 commentedon Jun 17, 2026
A shame. It'd be wonderful to not have to restart the kernel each time as modifying external .py files while building in/around a Jupyter file is super useful.
Regardless, I much appreciate you taking the time to confirm this behavior is 'as intended'.