Jupyter cell execution seems to have stopped after closing the workspace tab

Follow

Comments

1 comment

  • Jaclyn Patterson

    Hi Aman,

    Thanks for the question. This is a behavior we've seen with Jupyter. The key thing to note here is while the execution seems to have "stopped", it is only the output that is interrupted, not the code execution. In your example, if you were to print(i) in a new (second) cell below the sample code while leaving the first cell running, closing the tab, and then returning to it, you'll see that the new cell does not execute immediately. What's happening here is that Jupyter is still executing the cell but has stopped writing the output. The new cell appears to "hang" until the time.sleep(10) x 20 has run to its end.

    You can either wait for the time to run out or test this by hitting the stop button after you reopen the workspace and then just execute the second cell.

    More explanation about this behavior is here

    A couple of things you can do to handle this case:

    1. Use %%capture to store the output and print it at a later stage once the cell has finished executing.

    2. You can also convert the .ipynb to py and run code as a Job in Domino and look at the output.

    0
    Comment actions Permalink

Please sign in to leave a comment.