Jupyter Notebook内核安装错误

时间:2020-04-05 09:03:40

标签: python jupyter-notebook kernel

我正在使用Pycharm,并且安装了conda&Anaconda和jupyter项目,但是当我尝试“将项目解释器注册为内核”时,出现此错误,我该如何解决?

 Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
    from .connect import *
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\site-packages\ipykernel\connect.py", line 18, in <module>
    import jupyter_client
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\site-packages\jupyter_client\__init__.py", line 4, in <module>
    from .connect import *
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\site-packages\jupyter_client\connect.py", line 21, in <module>
    import zmq
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\site-packages\zmq\__init__.py", line 47, in <module>
    from zmq import backend
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
    raise value
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "C:\ProgramData\Anaconda3\envs\untitled1\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
    from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.

我还试图将jupyter笔记本(预先存在,这是我的作业,这就是为什么要开始使用它的重要原因)放在新的python项目中,如果有什么不同的话。 谢谢!

1 个答案:

答案 0 :(得分:5)

我刚遇到此问题,并已解决。 您可以在Pycharm终端中使用命令“ python -m ipykernel install --name XXXX”(xxxx是您的新内核名称)来创建新内核。 重新启动Pycharm,然后切换到新内核。