【问题标题】:Kernel error: ipykernel NotImplementedError内核错误:ipykernel NotImplementedError
【发布时间】:2022-02-09 18:29:12
【问题描述】:

错误信息

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 环境信息:

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

我尝试了This Github Issue,并按照This stackoverflow post的步骤。

复制步骤:

  • 安装 anaconda3
  • 使用conda create -n env python=3.8 创建 conda 环境
  • conda install -c anaconda jupyter
  • jupyter notebook

【问题讨论】:

    标签: python-3.x jupyter-notebook anaconda conda


    【解决方案1】:

    您显然已经安装了anaconda,但也安装了单独的python,看看C:\Users\sk_np\AppData\Roaming\Python\Python38G:\anaconda 是如何出现在您的回溯中的。由于包中的不一致,这可能是导致问题的原因。最简单的步骤,也是将来会让您省去很多麻烦的步骤,就是卸载您在

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

    另外,在您的 anaconda 提示符下运行(您尝试从该提示符启动 jupyter)

    jupyter kernelspec list
    

    然后删除位于C:\Users\sk_np\AppData\Roaming\Python\Python38 的内核

    jupyter kernelspec remove <kernelName>
    

    【讨论】:

    • 我认为 Python38 文件夹属于我的 conda env,它安装了 python 3.8。还有一个名为 Python310 的文件夹,这是我的默认文件夹 python 3.10
    • 不,不是您显示的命令。您使用conda create -n env python=3.8 创建的那个将在G:\anaconda\envs\env 中。这个文件夹听起来很像python从python.org/downloads/windows下载并安装到的默认位置
    猜你喜欢
    • 2020-10-22
    • 2021-08-13
    • 1970-01-01
    • 2022-11-01
    • 2017-07-30
    • 2010-12-06
    • 1970-01-01
    • 2020-07-12
    • 2019-03-14
    相关资源
    最近更新 更多