jupyter notebook error: FileNotFoundError: [WinError 2]

文章目录

  • 问题现象
  • 解决方法

问题现象

Traceback (most recent call last):
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\tornado\web.py", line 1592, in _execute
    result = yield result
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\tornado\gen.py", line 1133, in run
    value = future.result()
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\tornado\gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\notebook\services\sessions\handlers.py", line 73, in post
    type=mtype))
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\tornado\gen.py", line 1133, in run
    value = future.result()
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\tornado\gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 79, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\tornado\gen.py", line 1133, in run
    value = future.result()
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\tornado\gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 92, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\tornado\gen.py", line 1133, in run
    value = future.result()
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\tornado\gen.py", line 326, in wrapper
    yielded = next(result)
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 160, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\jupyter_client\manager.py", line 259, in start_kernel
    **kw)
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\jupyter_client\manager.py", line 204, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "D:\Anaconda3\envs\robot-env\lib\site-packages\jupyter_client\launcher.py", line 128, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "D:\Anaconda3\envs\robot-env\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "D:\Anaconda3\envs\robot-env\lib\subprocess.py", line 997, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

错误截图:
jupyter notebook error: FileNotFoundError: [WinError 2]_第1张图片

解决方法

  1. 进入python环境,如果是虚拟环境需要切换到对应的环境下,如下图:
    jupyter notebook error: FileNotFoundError: [WinError 2]_第2张图片
  2. 使用jupyter kernelspec list查询配置文件所在位置
    在这里插入图片描述
  3. 打开kernel.json文件,发现红框指定的python路径不正确,修改成正确的路径
    jupyter notebook error: FileNotFoundError: [WinError 2]_第3张图片
  4. 修改后的样子
    jupyter notebook error: FileNotFoundError: [WinError 2]_第4张图片
  5. 重新启动一次jupyter notebook即可。

你可能感兴趣的:(环境问题,jupyter,notebook,python)