'Kernel error: ipykernel NotImplementedError

Error Message

Traceback (most recent call last):
  File "G:\anaconda\envs\jup\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "G:\anaconda\envs\jup\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\sk_np\AppData\Roaming\Python\Python38\site-packages\ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "G:\anaconda\envs\jup\lib\site-packages\traitlets\config\application.py", line 844, in launch_instance
    app.initialize(argv)
  File "G:\anaconda\envs\jup\lib\site-packages\traitlets\config\application.py", line 87, in inner
    return method(app, *args, **kwargs)
  File "C:\Users\sk_np\AppData\Roaming\Python\Python38\site-packages\ipykernel\kernelapp.py", line 448, in initialize    self.init_sockets()
  File "C:\Users\sk_np\AppData\Roaming\Python\Python38\site-packages\ipykernel\kernelapp.py", line 251, in init_sockets
    self.init_iopub(context)
  File "C:\Users\sk_np\AppData\Roaming\Python\Python38\site-packages\ipykernel\kernelapp.py", line 259, in init_iopub    self.iopub_thread = IOPubThread(self.iopub_socket, pipe=True)
  File "C:\Users\sk_np\AppData\Roaming\Python\Python38\site-packages\ipykernel\iostream.py", line 63, in __init__
    self._setup_pipe_in()
  File "C:\Users\sk_np\AppData\Roaming\Python\Python38\site-packages\ipykernel\iostream.py", line 126, in _setup_pipe_in
    self._pipe_in = ZMQStream(pipe_in, self.io_loop)
  File "G:\anaconda\envs\jup\lib\site-packages\zmq\eventloop\zmqstream.py", line 127, in __init__
    self._init_io_state()
  File "G:\anaconda\envs\jup\lib\site-packages\zmq\eventloop\zmqstream.py", line 552, in _init_io_state
    self.io_loop.add_handler(self.socket, self._handle_events, self.io_loop.READ)
  File "G:\anaconda\envs\jup\lib\site-packages\tornado\platform\asyncio.py", line 100, in add_handler
    self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
  File "G:\anaconda\envs\jup\lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError

Conda Environment Info:

  • jupyter-client:7.1.2
  • jupyter_client:5.3.1
  • python:3.8.0

I tried This Github Issue and followed the steps of This stackoverflow post.

Reproduction steps:

  • Install anaconda3
  • create conda env with conda create -n env python=3.8
  • conda install -c anaconda jupyter
  • jupyter notebook


Solution 1:[1]

You have apparently anaconda installed, but also a seperate python installation, see how both C:\Users\sk_np\AppData\Roaming\Python\Python38 and G:\anaconda show up in your traceback. This is probably causing the issue due to inconsistencies in the packages. The simplest step, and the one that will save you a lot of headache in the future, would be to uninstall the python that you have at

C:\Users\sk_np\AppData\Roaming\Python\Python38

Additionally, run in your anaconda prompt (from which you tried to start jupyter)

jupyter kernelspec list

and then remove the kernel that is at C:\Users\sk_np\AppData\Roaming\Python\Python38 with

jupyter kernelspec remove <kernelName>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1