Python pdb调试器步进在Jupyter笔记本中不工作

Python pdb调试器步进在Jupyter笔记本中不工作,python,python-3.x,debugging,jupyter-notebook,jupyter,Python,Python 3.x,Debugging,Jupyter Notebook,Jupyter,我试图在Jupyter笔记本中使用“pdb”python调试器(),但它的行为并不像预期的那样 特别是,当我运行以下代码时 from pdb import set_trace set_trace() print("This is the next line") for j in range(0,5): print(j) 调试器按预期输入,显示 --Return-- > <ipython-input-4-ed8fefd89436>(3)<module>()

我试图在Jupyter笔记本中使用“pdb”python调试器(),但它的行为并不像预期的那样

特别是,当我运行以下代码时

from pdb import set_trace

set_trace()
print("This is the next line")
for j in range(0,5):
    print(j)
调试器按预期输入,显示

--Return--
> <ipython-input-4-ed8fefd89436>(3)<module>()->None
-> set_trace()
再输入几次
n

--Return--
> <ipython-input-4-ed8fefd89436>(3)<module>()->None
-> set_trace()
(Pdb) n
> c:\python\lib\site-packages\ipython\core\interactiveshell.py(2913)run_code()
-> sys.excepthook = old_excepthook
(Pdb) n
> c:\python\lib\site-packages\ipython\core\interactiveshell.py(2929)run_code()
-> outflag = False
(Pdb) n
> c:\python\lib\site-packages\ipython\core\interactiveshell.py(2930)run_code()
-> return outflag
(Pdb) n
--Return--
> c:\python\lib\site-packages\ipython\core\interactiveshell.py(2930)run_code()->False
-> return outflag
(Pdb) n
> c:\python\lib\site-packages\ipython\core\interactiveshell.py(2847)run_ast_nodes()
-> for i, node in enumerate(to_run_exec):
——返回--
>(3)无
->set_trace()
(Pdb)n
>c:\python\lib\site packages\ipython\core\interactiveshell.py(2913)run_code()
->sys.excepthook=old_excepthook
(Pdb)n
>c:\python\lib\site packages\ipython\core\interactiveshell.py(2929)run_code()
->溢出=错误
(Pdb)n
>c:\python\lib\site packages\ipython\core\interactiveshell.py(2930)run_code()
->回流外流
(Pdb)n
--返回--
>c:\python\lib\site packages\ipython\core\interactiveshell.py(2930)run_code()->False
->回流外流
(Pdb)n
>c:\python\lib\site packages\ipython\core\interactiveshell.py(2847)run\u ast\u nodes()
->对于i,枚举(to_run_exec)中的节点:

这是怎么回事?调试器正在执行的代码不是我的…

ipython
控制台(qt或plain)中运行调试器如何。你没有调试需要笔记本格式的东西,是吗?我的代码确实不需要笔记本格式,但我在网上读到的所有东西都表明这个调试器应该在笔记本中工作,所以我只是对它不需要的事实感到困惑(和担心)。这已经在另一篇文章中得到了回答。请参阅此链接:
--Return--
> <ipython-input-4-ed8fefd89436>(3)<module>()->None
-> set_trace()
(Pdb) n
> c:\python\lib\site-packages\ipython\core\interactiveshell.py(2913)run_code()
-> sys.excepthook = old_excepthook
(Pdb) n
> c:\python\lib\site-packages\ipython\core\interactiveshell.py(2929)run_code()
-> outflag = False
(Pdb) n
> c:\python\lib\site-packages\ipython\core\interactiveshell.py(2930)run_code()
-> return outflag
(Pdb) n
--Return--
> c:\python\lib\site-packages\ipython\core\interactiveshell.py(2930)run_code()->False
-> return outflag
(Pdb) n
> c:\python\lib\site-packages\ipython\core\interactiveshell.py(2847)run_ast_nodes()
-> for i, node in enumerate(to_run_exec):