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
Hang after running pdb in a cell, Kernel/Interrupt doesn't help #10516
If you debug a cell via pdb, then don't quit it before rerunning the cell, you can't get back to your IPython environment. Reproduce it via Test case for pdb hang in Jupyter notebook. Here's a screenshot:
For the record and search engines, to hang your notebook:
Note that Kernel/Interupt doesn't help. You can save the notebook, but to run cells again, you need to restart the kernel, at which point "All variables will be lost"
This happens to me not infrequently if I am searching thru the rest of the notebook for hints on how to debug the cell, then forget to quit before changing the cell and running it again. Yes, I can be more careful, but others have the same experience. Thanks to @wmayner for a convenient test case described at #3400.
I'm running Jupyter notebook 4.3.1 on Python 3.4.3 (default, Nov 17 2016, 01:08:31) [GCC 4.8.4]
Kernel Information: Python 3.4.3 (default, Nov 17 2016, 01:08:31)
pdb runs in the same process, and we do know when it's expecting input. I think it needs someone to do the work so that when the HTML input box is removed in the frontend, a message is sent back to the kernel which will raise EOFError.
That may need a new message type, or we could do it as a metadata field on the existing stdin reply message.
Reacted by i-aztec, Daniel Olson, William Mayner, Anton Streltsov, Jeffrey Liu, iNLyze, Luca Innocenti, Spencer Bliven, Ian Hincks, Markus Mayer and 63 more
Absolutely, same here. This is a royal pain in the rather sensitive parts of my body. If a convenient way to stop pdb from without the running cell existed this could be alleviated. Alternatively, at least a way of saving your work before shutting down the notebook would be important (e.g. trained neural network and the notebook crashes on save after 2000 epochs).
Reacted by Luca Innocenti, vishaalprasad, Alexander Steppke, Yu Tachibana, German, Christian Laforte, laurathepluralized, William Lee, Carlo de Franchis, Il'dar Lomov and 6 more
Just got bitten by this as well. How do people typically debug in jupyter notebook? Using pdb is like juggling a grenade :(
Reacted by William Mayner, James, Brian J. Bowler, Guillem Cucurull, Jonathan Terhorst, zsal, Quy Dinh, Malte Esders, Andrew Rouditchenko, Sai Sumanth Miryala and 9 more
Same problem here. Need a way to interrupt a runaway process or one that is "waiting" on input and get control back ... even if I can no longer get to the input prompt.
I'm a newby - How on earth do advanced programmers debug in notebooks? Surely they don't use PDB with this "time bomb" in it? Please, share your secrets! :)
As soon as there is a new IPykernel release, this can be closed as fixed.
Reacted by Alexander Steppke, Louis M., Berkeley Malagon, Spencer Bliven, Yonadav Shavit, Samuel Sinayoko, Takuma Ishikawa, Vitya Alexandrov and michaheilbron
Currently working in a pretty bulky environment so cannot rule out some dependencies might be causing it? I can try to see if the error also reproduces in a minimal environment if that would be useful?
Activity
danolson1 commentedon Jun 22, 2017
I am running into the same problem.
iNLyze commentedon Aug 15, 2017
Absolutely, same here. This is a royal pain in the rather sensitive parts of my body. If a convenient way to stop pdb from without the running cell existed this could be alleviated. Alternatively, at least a way of saving your work before shutting down the notebook would be important (e.g. trained neural network and the notebook crashes on save after 2000 epochs).
vsbuffalo commentedon Aug 23, 2017
I also have this issue, with Jupyter version 4.30, Python 3.6.2. Restarting the kernel appears to be the only way to handle this issue.
ihincks commentedon Oct 5, 2017
Just lost an 8 hour calculation due to this...time to start again.
hsorsky commentedon Jul 6, 2018
Just lost a 64 hour calculation on which I'm meant to be presenting results today -.-
No one found a solution?
WilliamCarlos commentedon Aug 22, 2018
Just got bitten by this as well. How do people typically debug in jupyter notebook? Using pdb is like juggling a grenade :(
olabreche commentedon Sep 26, 2018
Please please please fix this! I am constantly getting this issue.
cristianmtr commentedon Nov 12, 2018
Same here. Have to redo a very long calculation
joel-odlund commentedon Nov 21, 2018
same here.
zsal commentedon Nov 22, 2018
someone please fix and I will pay you $5
sbliven commentedon Nov 30, 2018
@zsal If you're serious, you could add this is issue on https://www.bountysource.com
jerrykaplan commentedon Apr 28, 2019
Same problem here. Need a way to interrupt a runaway process or one that is "waiting" on input and get control back ... even if I can no longer get to the input prompt.
I'm a newby - How on earth do advanced programmers debug in notebooks? Surely they don't use PDB with this "time bomb" in it? Please, share your secrets! :)
handrew commentedon Apr 28, 2019
+1
carrutstick commentedon Jul 24, 2019
+1
9 remaining items
minrk commentedon Mar 3, 2020
itamarst commentedon Mar 3, 2020
@minrk is correct and I was wrong, sorry.
itamarst commentedon Apr 22, 2020
To get this fix in, the following needs to happen:
louismartin commentedon Apr 22, 2020
Thanks so much for looking into this!!
itamarst commentedon May 27, 2020
As soon as there is a new IPykernel release, this can be closed as fixed.
itamarst commentedon Jun 11, 2020
Done! This can be closed.
vityas commentedon Jun 23, 2020
KeyboardInterrupt seems to do nothing in my case. Is that the expected behavior?
itamarst commentedon Jun 23, 2020
I would expect that to interrupt. I will see if I can reproduce. This is Windows, yes?
vityas commentedon Jun 23, 2020
macOS 10.15.5
Oh, so this is not expected. Let me know if there is any info I can add to clarify.
michaheilbron commentedon Jun 24, 2020
For me problem also persisted after updating. Also on the remote linux compute nodes I use for work, see:
Currently working in a pretty bulky environment so cannot rule out some dependencies might be causing it? I can try to see if the error also reproduces in a minimal environment if that would be useful?
Carreau commentedon Jun 26, 2020
This needs master of IPykernel that has not been released yet.