jupyter notebook error: FileNotFoundError: [WinError 2]

匿名 (未验证) 提交于 2019-12-02 22:56:40

问题现象

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] 系统找不到指定的文件。 

错误截图:

解决方法

  1. 进入python环境,如果是虚拟环境需要切换到对应的环境下,如下图:
  2. 使用jupyter kernelspec list查询配置文件所在位置
  3. 打开kernel.json文件,发现红框指定的python路径不正确,修改成正确的路径
  4. 修改后的样子
  5. 重新启动一次jupyter notebook即可。
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!