notebook: jupyter - Failed to start the kernel

Working on Windows 10. I installed Anaconda2 and jupyter. When I run jupyter notebook, the notebook launches but when I ask for new python2 kernel the kernel fails to start and I get below error. On continuum’s troubleshoot assistance I verified and updated the system environment path variables and also ran ‘conda install -f jupyter ipykernel’ & ‘jupyter notebook --generate-config’. But the kernel still fails to start. Please help. Thanks!

Traceback (most recent call last):
  File "E:\Programs\Anaconda2\lib\site-packages\notebook\base\handlers.py", line 458, in wrapper
    result = yield gen.maybe_future(method(self, *args, **kwargs))
  File "E:\Programs\Anaconda2\lib\site-packages\tornado\gen.py", line 1008, in run
    value = future.result()
  File "E:\Programs\Anaconda2\lib\site-packages\tornado\concurrent.py", line 232, in result
    raise_exc_info(self._exc_info)
  File "E:\Programs\Anaconda2\lib\site-packages\tornado\gen.py", line 1014, in run
    yielded = self.gen.throw(*exc_info)
  File "E:\Programs\Anaconda2\lib\site-packages\notebook\services\sessions\handlers.py", line 58, in post
    sm.create_session(path=path, kernel_name=kernel_name))
  File "E:\Programs\Anaconda2\lib\site-packages\tornado\gen.py", line 1008, in run
    value = future.result()
  File "E:\Programs\Anaconda2\lib\site-packages\tornado\concurrent.py", line 232, in result
    raise_exc_info(self._exc_info)
  File "E:\Programs\Anaconda2\lib\site-packages\tornado\gen.py", line 1014, in run
    yielded = self.gen.throw(*exc_info)
  File "E:\Programs\Anaconda2\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 73, in create_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "E:\Programs\Anaconda2\lib\site-packages\tornado\gen.py", line 1008, in run
    value = future.result()
  File "E:\Programs\Anaconda2\lib\site-packages\tornado\concurrent.py", line 232, in result
    raise_exc_info(self._exc_info)
  File "E:\Programs\Anaconda2\lib\site-packages\tornado\gen.py", line 282, in wrapper
    yielded = next(result)
  File "E:\Programs\Anaconda2\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 87, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "E:\Programs\Anaconda2\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "E:\Programs\Anaconda2\lib\site-packages\jupyter_client\manager.py", line 243, in start_kernel
    **kw)
  File "E:\Programs\Anaconda2\lib\site-packages\jupyter_client\manager.py", line 189, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "E:\Programs\Anaconda2\lib\site-packages\jupyter_client\launcher.py", line 123, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "E:\Programs\Anaconda2\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "E:\Programs\Anaconda2\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (3 by maintainers)

Most upvoted comments

I’d guess that you created the kernelspec for an environment which you’ve now deleted or removed. Can you do jupyter kernelspec list to see where your kernelspecs are?

Thanks for your quick revert Thomas!! I updated the path variable in kernel.json and the kernel error is now gone 😃 For the benefit of others, if any, struggling with this error… It was: “argv”: [ “e:\programs\anaconda\python.exe”,

and I changed it to: “argv”: [ “e:\programs\anaconda2\python.exe”,

I had this issue for awhile. The solution that worked for me is: Close jupyter notebook and anaconda. And then run Anaconda again by run as administrator. And then launch jupyter notebook. for future use you can change the properties of anaconda to run as administrator every time you launch.

I’m running Jupyter on linux server with Miniconda and faced a similar problem. I searched on internet but didn’t find solutions so here’s how I solved it:

If you are having issues with R notebooks, you need to manually edit the kernel pointer to point to R runtime. Conda uses ‘R’ alias as default in the configuration, which results in KERNEL ERROR “File or folder not found ‘R’”

Open to edit the R kernel: nano ~/miniconda3/share/jupyter/kernels/ir/kernel.json

You should change the argv to full path of R, which is under the bin:

{
  "argv": [
    "/home/<your_username>/miniconda3/bin/R",
    "--slave",
    "-e",
    "IRkernel::main()",
    "--args",
    "{connection_file}"
  ],
  "display_name": "R",
  "language": "R"
}

😎