No cell output after kernel restart

After one kernel restart in Jupyter notebook, In cells do not produce any Out cell. Evaluation seems to go on normally since In number increments and import beepy;beepy.beep() beeps. Normal behaviour returns after many restarts but after some time again I see the problem.

How to get rid of this?

Messages in terminal:

[I 14:34:31.619 NotebookApp] Replaying 13 buffered messages
[E 14:34:31.844 NotebookApp] Uncaught exception in ZMQStream callback
    Traceback (most recent call last):
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
        f = callback(*args, **kwargs)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 308, in stream_callback
        return callback(self, msg)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/notebook/services/kernels/handlers.py", line 572, in _on_zmq_reply
        super()._on_zmq_reply(stream, msg)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/notebook/base/zmqhandlers.py", line 256, in _on_zmq_reply
        self.write_message(msg, binary=isinstance(msg, bytes))
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/websocket.py", line 334, in write_message
        return self.ws_connection.write_message(message, binary=binary)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/websocket.py", line 1081, in write_message
        fut = self._write_frame(True, opcode, message, flags=flags)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/websocket.py", line 1056, in _write_frame
        return self.stream.write(frame)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/iostream.py", line 539, in write
        self._handle_write()
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/iostream.py", line 965, in _handle_write
        self._write_buffer.advance(num_bytes)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/iostream.py", line 182, in advance
        assert 0 < size <= self._size
    AssertionError
[E 14:34:31.844 NotebookApp] Uncaught exception in zmqstream callback
    Traceback (most recent call last):
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 634, in _handle_events
        self._handle_recv()
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 663, in _handle_recv
        self._run_callback(callback, msg)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
        f = callback(*args, **kwargs)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 308, in stream_callback
        return callback(self, msg)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/notebook/services/kernels/handlers.py", line 572, in _on_zmq_reply
        super()._on_zmq_reply(stream, msg)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/notebook/base/zmqhandlers.py", line 256, in _on_zmq_reply
        self.write_message(msg, binary=isinstance(msg, bytes))
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/websocket.py", line 334, in write_message
        return self.ws_connection.write_message(message, binary=binary)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/websocket.py", line 1081, in write_message
        fut = self._write_frame(True, opcode, message, flags=flags)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/websocket.py", line 1056, in _write_frame
        return self.stream.write(frame)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/iostream.py", line 539, in write
        self._handle_write()
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/iostream.py", line 965, in _handle_write
        self._write_buffer.advance(num_bytes)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/iostream.py", line 182, in advance
        assert 0 < size <= self._size
    AssertionError
[E 14:34:31.845 NotebookApp] Exception in callback functools.partial(<function ZMQStream._update_handler.<locals>.<lambda> at 0x7efc19857b50>)
    Traceback (most recent call last):
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/ioloop.py", line 738, in _run_callback
        ret = callback()
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 718, in <lambda>
        self.io_loop.add_callback(lambda: self._handle_events(self.socket, 0))
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 634, in _handle_events
        self._handle_recv()
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 663, in _handle_recv
        self._run_callback(callback, msg)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
        f = callback(*args, **kwargs)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 308, in stream_callback
        return callback(self, msg)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/notebook/services/kernels/handlers.py", line 572, in _on_zmq_reply
        super()._on_zmq_reply(stream, msg)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/notebook/base/zmqhandlers.py", line 256, in _on_zmq_reply
        self.write_message(msg, binary=isinstance(msg, bytes))
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/websocket.py", line 334, in write_message
        return self.ws_connection.write_message(message, binary=binary)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/websocket.py", line 1081, in write_message
        fut = self._write_frame(True, opcode, message, flags=flags)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/websocket.py", line 1056, in _write_frame
        return self.stream.write(frame)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/iostream.py", line 539, in write
        self._handle_write()
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/iostream.py", line 965, in _handle_write
        self._write_buffer.advance(num_bytes)
      File "/home/alba/.conda/envs/jupyter/lib/python3.10/site-packages/tornado/iostream.py", line 182, in advance
        assert 0 < size <= self._size
    AssertionError

I have installed with conda and pip.

The notebook is big (2,7 MB). I do not see the problem in a small notebook. (Sorry I was unable to edit original post.)

I have tried with Anaconda, same problem, so it does not depend on my own install. After some time at work on the notebook, new outputs are not displayed. Often, this can be repaired by restarting the kernel one or many times or eventually restarting Jupyter Notebook.

(anaconda) alba@mac2011-manjaro% conda list jupyter
# packages in environment at /home/alba/.conda/envs/anaconda:
#
# Name                    Version                   Build  Channel
jupyter                   1.0.0           py311h06a4308_8  
jupyter_client            8.1.0           py311h06a4308_0  
jupyter_console           6.6.3           py311h06a4308_0  
jupyter_core              5.3.0           py311h06a4308_0  
jupyter_events            0.6.3           py311h06a4308_0  
jupyter_server            2.5.0           py311h06a4308_0  
jupyter_server_fileid     0.9.0           py311h06a4308_0  
jupyter_server_terminals  0.4.4           py311h06a4308_1  
jupyter_server_ydoc       0.8.0           py311h06a4308_1  
jupyter_ydoc              0.2.4           py311h06a4308_0  
jupyterlab                3.6.3           py311h06a4308_0  
jupyterlab_pygments       0.1.2                      py_0  
jupyterlab_server         2.22.0          py311h06a4308_0  
jupyterlab_widgets        3.0.5           py311h06a4308_0

Hi, I’m having the same problem. The output cells display for a little while then they stop diplaying. Cells which previously displayed aren’t displaying anymore, and it takes a few kernel restarts to get them to work again.

Did you work out what’s causing this?