My Kernel always dies in the same spot (in Jupyter Notebook)

148 Views Asked by At

I have to say that I'm not really knowledgeable at coding since I'm learning by myself how to use Python through Jupyter Notebook to do data analysis. Given that, I'm not able to understand why my Kernel always dies in the same spot, on the same cell, in the same notebook.

The error that pops up is that:

Exception in callback functools.partial(<function ZMQStream._update_handler.<locals>.<lambda> at 0x7fc9003283a0>)
    Traceback (most recent call last):
      File "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/tornado/ioloop.py", line 738, in _run_callback
        ret = callback()
      File "/Users/davidegualano/anaconda3/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 "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 634, in _handle_events
        self._handle_recv()
      File "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 663, in _handle_recv
        self._run_callback(callback, msg)
      File "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
        f = callback(*args, **kwargs)
      File "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 308, in stream_callback
        return callback(self, msg)
      File "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/notebook/services/kernels/handlers.py", line 572, in _on_zmq_reply
        super()._on_zmq_reply(stream, msg)
      File "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/notebook/base/zmqhandlers.py", line 256, in _on_zmq_reply
        self.write_message(msg, binary=isinstance(msg, bytes))
      File "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/tornado/websocket.py", line 334, in write_message
        return self.ws_connection.write_message(message, binary=binary)
      File "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/tornado/websocket.py", line 1081, in write_message
        fut = self._write_frame(True, opcode, message, flags=flags)
      File "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/tornado/websocket.py", line 1056, in _write_frame
        return self.stream.write(frame)
      File "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/tornado/iostream.py", line 539, in write
        self._handle_write()
      File "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/tornado/iostream.py", line 965, in _handle_write
        self._write_buffer.advance(num_bytes)
      File "/Users/davidegualano/anaconda3/lib/python3.10/site-packages/tornado/iostream.py", line 182, in advance
        assert 0 < size <= self._size
    AssertionError

I think I've read online this is related to tornado and downgrading it resolved things for other people. I've tried it but the result stayed the same. I don't know what to do to solve things.

0

There are 0 best solutions below