Launching Jupyter ALWAYS results in Kernel Failure

Have uninstalled, re-installed Anaconda multiple times and still unable tto use JupyterLab or Jupyter Notebook.
Whenever I launch either one and attempt open or create a new notebook I get a kernel faliure with the following error message. I have no idea of what file it is looking for and have been chasing this problem for six months - any help appreciated.

Traceback (most recent call last):
File “D:\Anaconda_3\lib\site-packages\tornado\web.py”, line 1704, in _execute
result = await result
File “D:\Anaconda_3\lib\asyncio\tasks.py”, line 328, in __wakeup
future.result()
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “D:\Anaconda_3\lib\site-packages\notebook\services\sessions\handlers.py”, line 74, in post
model = yield maybe_future(
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “D:\Anaconda_3\lib\site-packages\notebook\services\sessions\sessionmanager.py”, line 98, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “D:\Anaconda_3\lib\site-packages\notebook\services\sessions\sessionmanager.py”, line 110, in start_kernel_for_session
kernel_id = yield maybe_future(
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “D:\Anaconda_3\lib\asyncio\futures.py”, line 201, in result
raise self._exception
File “D:\Anaconda_3\lib\asyncio\tasks.py”, line 256, in __step
result = coro.send(None)
File “D:\Anaconda_3\lib\site-packages\notebook\services\kernels\kernelmanager.py”, line 176, in start_kernel
kernel_id = await maybe_future(self.pinned_superclass.start_kernel(self, **kwargs))
File “D:\Anaconda_3\lib\site-packages\jupyter_client\multikernelmanager.py”, line 186, in start_kernel
km.start_kernel(**kwargs)
File “D:\Anaconda_3\lib\site-packages\jupyter_client\manager.py”, line 341, in start_kernel
self.kernel = self._launch_kernel(kernel_cmd, **kw)
File “D:\Anaconda_3\lib\site-packages\jupyter_client\manager.py”, line 249, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File “D:\Anaconda_3\lib\site-packages\jupyter_client\launcher.py”, line 132, in launch_kernel
proc = Popen(cmd, **kwargs)
File “D:\Anaconda_3\lib\subprocess.py”, line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “D:\Anaconda_3\lib\subprocess.py”, line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

Hi @Marty_DiStasio - welcome to the community!

This error is usually an indication that the selected kernel specification (aka, kernelspec) is referencing a module that is no longer available - typically due to removed python/conda envs. To help get to the bottom of this, run jupyter kernelspec list, identify the location relative to the kernel you’re currently having issues with, and open that location’s kernel.json file. Then ensure that the argv entry is pointing at a valid python executable. This is likely referencing an absolute path to a module that no longer exists.

I find just having python as the executable works well because it isn’t pinning the location and lets the active environment/configuration determine which python should be invoked.

2 Likes

Kevin,
Thanks for the suggestion. I tried it and still get nowhere. If you have time & energy & patience I pasted notes to show my attempts so far.

Have uninstalled, re-installed Anaconda multiple times and still unable tto use JupyterLab or Jupyter Notebook.
Whenever I launch either one and attempt open or create a new notebook I get a kernel faliure with the following error message. I have no idea of what file it is looking for and have been chasing this problem for six months - any help appreciated.

Traceback (most recent call last):
File “D:\Anaconda_3\lib\site-packages\tornado\web.py”, line 1704, in _execute
result = await result
File “D:\Anaconda_3\lib\asyncio\tasks.py”, line 328, in __wakeup
future.result()
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “D:\Anaconda_3\lib\site-packages\notebook\services\sessions\handlers.py”, line 74, in post
model = yield maybe_future(
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “D:\Anaconda_3\lib\site-packages\notebook\services\sessions\sessionmanager.py”, line 98, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “D:\Anaconda_3\lib\site-packages\notebook\services\sessions\sessionmanager.py”, line 110, in start_kernel_for_session
kernel_id = yield maybe_future(
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “D:\Anaconda_3\lib\asyncio\futures.py”, line 201, in result
raise self._exception
File “D:\Anaconda_3\lib\asyncio\tasks.py”, line 256, in __step
result = coro.send(None)
File “D:\Anaconda_3\lib\site-packages\notebook\services\kernels\kernelmanager.py”, line 176, in start_kernel
kernel_id = await maybe_future(self.pinned_superclass.start_kernel(self, **kwargs))
File “D:\Anaconda_3\lib\site-packages\jupyter_client\multikernelmanager.py”, line 186, in start_kernel
km.start_kernel(**kwargs)
File “D:\Anaconda_3\lib\site-packages\jupyter_client\manager.py”, line 341, in start_kernel
self.kernel = self._launch_kernel(kernel_cmd, **kw)
File “D:\Anaconda_3\lib\site-packages\jupyter_client\manager.py”, line 249, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File “D:\Anaconda_3\lib\site-packages\jupyter_client\launcher.py”, line 132, in launch_kernel
proc = Popen(cmd, **kwargs)
File “D:\Anaconda_3\lib\subprocess.py”, line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “D:\Anaconda_3\lib\subprocess.py”, line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

=======================================================================================================================================================================
kevin-bates
Distinguished Contributor
2d
Hi @Marty_DiStasio - welcome to the community!

This error is usually an indication that the selected kernel specification (aka, kernelspec) is referencing a module that is no longer available - typically due to removed python/conda envs. To help get to the bottom of this, run jupyter kernelspec list, identify the location relative to the kernel you’re currently having issues with, and open that location’s kernel.json file. Then ensure that the argv entry is pointing at a valid python executable. This is likely referencing an absolute path to a module that no longer exists.

I find just having python as the executable works well because it isn’t pinning the location and lets the active environment/configuration determine which python should be invoked.

====================================================================================
07/01/2022
Launched Anaconda prompt
issued “jupyter kernelspec”

(base) C:\Users\zwitter689>jupyter kernelspec list
Available kernels:
mmd_py C:\Users\zwitter689\AppData\Roaming\jupyter\kernels\mmd_py
python3 C:\Users\zwitter689\AppData\Roaming\jupyter\kernels\python3

(base) C:\Users\zwitter689>d:


So it looks like the python .exe file is at C:\Users\zwitter689\AppData\Roaming\jupyter\kernels\

Edited the kernel.json file that I found in D:\Anaconda_3\share\jupyter\kernels\python3

{
“argv”: [
“C:\Users\zwitter689\AppData\Roaming\jupyter\kernels\python3”
“-m”,
“ipykernel_launcher”,
“-f”,
“{connection_file}”
],
“display_name”: “Python 3 (ipykernel)”,
“language”: “python”,
“metadata”: {
“debugger”: true
}
}

Relaunched jupyter notebook and get the same kernel failure
together with the following details which look like the prior one


Traceback (most recent call last):
File “D:\Anaconda_3\lib\site-packages\tornado\web.py”, line 1704, in _execute
result = await result
File “D:\Anaconda_3\lib\asyncio\tasks.py”, line 328, in __wakeup
future.result()
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “D:\Anaconda_3\lib\site-packages\notebook\services\sessions\handlers.py”, line 74, in post
model = yield maybe_future(
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “D:\Anaconda_3\lib\site-packages\notebook\services\sessions\sessionmanager.py”, line 98, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “D:\Anaconda_3\lib\site-packages\notebook\services\sessions\sessionmanager.py”, line 110, in start_kernel_for_session
kernel_id = yield maybe_future(
File “D:\Anaconda_3\lib\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “D:\Anaconda_3\lib\asyncio\futures.py”, line 201, in result
raise self._exception
File “D:\Anaconda_3\lib\asyncio\tasks.py”, line 256, in __step
result = coro.send(None)
File “D:\Anaconda_3\lib\site-packages\notebook\services\kernels\kernelmanager.py”, line 176, in start_kernel
kernel_id = await maybe_future(self.pinned_superclass.start_kernel(self, **kwargs))
File “D:\Anaconda_3\lib\site-packages\jupyter_client\multikernelmanager.py”, line 186, in start_kernel
km.start_kernel(**kwargs)
File “D:\Anaconda_3\lib\site-packages\jupyter_client\manager.py”, line 341, in start_kernel
self.kernel = self._launch_kernel(kernel_cmd, **kw)
File “D:\Anaconda_3\lib\site-packages\jupyter_client\manager.py”, line 249, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File “D:\Anaconda_3\lib\site-packages\jupyter_client\launcher.py”, line 132, in launch_kernel
proc = Popen(cmd, **kwargs)
File “D:\Anaconda_3\lib\subprocess.py”, line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “D:\Anaconda_3\lib\subprocess.py”, line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

So I am still clueless & “jupyter notebook-less” and appreciate any suggestions

I’m not very familiar with troubleshooting Jupyter issues on Windows, but I suspect this might be a “drive” issue and I’m not sure if Jupyter spans drives (although if fully qualified, I don’t see why it wouldn’t).

What was the value of argv before you changed it to C:\Users\zwitter689\AppData\Roaming\jupyter\kernels\python3? That is an odd location for the python executable to reside, and I suspect that that directory (folder) is merely the kernelspec for a kernel installed on your C drive. Does that folder also contain a kernel.json file? Given the other information in your post, I would expect a python executable to reside in D:\Anaconda_3\bin, but, again, I’m not familiar with Windows configurations.

Instead, since you know you’re attempting to execute the kernelspec at D:\Anaconda_3\share\jupyter\kernels\python3, I would update that kernel.json’s argv stanza to simply reference “python” (or “python3”) as its first element. That is, let the kernel launch machinery use your PATH configuration to locate the executable, rather than trying to pin it to an exact location. By taking this approach, then the python used should be more of a function of the active conda environment you’re using - which is typically what you’ll want.

I’d be happy to hear from others more familiar with troubleshooting kernel launch issues on Windows.