Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1543, in _execute
result = yield result
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(*exc_info)
File "/usr/local/lib/python3.6/dist-packages/notebook/services/sessions/handlers.py", line 73, in post
type=mtype))
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(*exc_info)
File "/usr/local/lib/python3.6/dist-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 "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(*exc_info)
File "/usr/local/lib/python3.6/dist-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 "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 315, in wrapper
yielded = next(result)
File "/usr/local/lib/python3.6/dist-packages/notebook/services/kernels/kernelmanager.py", line 148, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "/usr/local/lib/python3.6/dist-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "/usr/local/lib/python3.6/dist-packages/jupyter_client/manager.py", line 240, in start_kernel
self.write_connection_file()
File "/usr/local/lib/python3.6/dist-packages/jupyter_client/connect.py", line 472, in write_connection_file
kernel_name=self.kernel_name
File "/usr/local/lib/python3.6/dist-packages/jupyter_client/connect.py", line 137, in write_connection_file
with open(fname, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/run/user/1001/jupyter/kernel-0a4fc467-a872-4c9c-95ad-4d8cf441bb8d.json'
Reinstalling Jupyter fixes the issue briefly, but it eventually pops up again.
possibly same problem as recent issue #3481.
They're both FileNotFoundError, but they come from different bits of the code. I think your issue is the same as this one: https://github.com/jupyter/jupyter_client/issues/351
Thanks! You're right, it's the same issue. And it does seem that problems tend to occur when i've logged back into my Jupyter notebook after logging out with it running.
Do you know if there's any way to tell Jupyter to just use my home directory (or some other custom directory) for these files?
You can set an environment variable JUPYTER_RUNTIME_DIR to put those files somewhere else:
http://jupyter.readthedocs.io/en/latest/projects/jupyter-directories.html#runtime-files
Or you can recreate the default dir : mkdir /run/user/$UID/jupyter
how about the following close error, it's not getting me the file it can't find:
Traceback (most recent call last):
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packagestornado\web.py", line 1592, in _execute
result = yield result
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packagestornado\gen.py", line 1133, in run
value = future.result()
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\asyncio\futures.py", line 274, in result
raise self._exception
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packagestornado\gen.py", line 1141, in run
yielded = self.gen.throw(exc_info)
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packages\notebook\services\sessions\handlers.py", line 73, in post
type=mtype))
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packagestornado\gen.py", line 1133, in run
value = future.result()
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\asyncio\futures.py", line 274, in result
raise self._exception
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packagestornado\gen.py", line 1141, in run
yielded = self.gen.throw(exc_info)
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\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 "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packagestornado\gen.py", line 1133, in run
value = future.result()
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\asyncio\futures.py", line 274, in result
raise self._exception
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packagestornado\gen.py", line 1141, in run
yielded = self.gen.throw(exc_info)
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\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 "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packagestornado\gen.py", line 1133, in run
value = future.result()
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\asyncio\futures.py", line 274, in result
raise self._exception
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packagestornado\gen.py", line 326, in wrapper
yielded = next(result)
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 160, in start_kernel
super(MappingKernelManager, self).start_kernel(kwargs)
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(kwargs)
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packages\jupyter_client\manager.py", line 259, in start_kernel
*kw)
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packages\jupyter_client\manager.py", line 204, in _launch_kernel
return launch_kernel(kernel_cmd, *kw)
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\site-packages\jupyter_client\launcher.py", line 128, in launch_kernel
proc = Popen(cmd, *kwargs)
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "C:\Users\Asus\Anaconda3\envs\carnd-term1\lib\subprocess.py", line 1224, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
This is more like #3481. The file that can't be found is most likely the one referenced as the first item in the argv stanza/array of the kernel.json file corresponding to the kernel that you're attempting to start. As noted in the referenced issue, you should be able to use jupyter kernelspec list to help locate the appropriate kernel.json file.
Whatever command appears in that item, ensure it is valid relative to your environment.
@kevin-bates
I checked out the file kernel.json, and found that the input:
"argv": [
"C:/Users/Asus/Anaconda3/envs/carnd-term1/bin/python"
is pointing to path not exist in my machine, does that mean I don't have python kernel in this environment, what should I do to fix that
very thankful in advance..
according to issue #2563
I replaced the invalid path with 'python3' and it worked for me
thank you
Closing this issue as it has been resolved.
This is more like #3481. The file that can't be found is most likely the one referenced as the first item in the
argvstanza/array of the kernel.json file corresponding to the kernel that you're attempting to start. As noted in the referenced issue, you should be able to usejupyter kernelspec listto help locate the appropriate kernel.json file.Whatever command appears in that item, ensure it is valid relative to your environment.
That did trick for me.
Found json file and reference to python.exe to nonexisting Miniconda installation. Changed that to current path where python.exe is and now everything works.
Don't forget to add extra "\" after you paste windows path.
My kernel.json was in
C:\Users\pero\AppData\Roaming\jupyter\kernels\python3
It looks now like this:
{
"argv": [
"C:\\Program Files\\Python37\\python.exe",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python 3",
"language": "python"
}
\ProgramData\Anaconda3\lib\site-packagestornado\web.py", line 1592, in _execute
result = yield result
File "C:\ProgramData\Anaconda3\lib\site-packagestornado\gen.py", line 1133, in run
value = future.result()
File "C:\ProgramData\Anaconda3\lib\site-packagestornado\gen.py", line 1141, in run
yielded = self.gen.throw(exc_info)
File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\services\sessions\handlers.py", line 73, in post
type=mtype))
File "C:\ProgramData\Anaconda3\lib\site-packagestornado\gen.py", line 1133, in run
value = future.result()
File "C:\ProgramData\Anaconda3\lib\site-packagestornado\gen.py", line 1141, in run
yielded = self.gen.throw(exc_info)
File "C:\ProgramData\Anaconda3\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 "C:\ProgramData\Anaconda3\lib\site-packagestornado\gen.py", line 1133, in run
value = future.result()
File "C:\ProgramData\Anaconda3\lib\site-packagestornado\gen.py", line 1141, in run
yielded = self.gen.throw(exc_info)
File "C:\ProgramData\Anaconda3\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 "C:\ProgramData\Anaconda3\lib\site-packagestornado\gen.py", line 1133, in run
value = future.result()
File "C:\ProgramData\Anaconda3\lib\site-packagestornado\gen.py", line 326, in wrapper
yielded = next(result)
File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 160, in start_kernel
super(MappingKernelManager, self).start_kernel(kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\manager.py", line 259, in start_kernel
*kw)
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\manager.py", line 204, in _launch_kernel
return launch_kernel(kernel_cmd, *kw)
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\launcher.py", line 128, in launch_kernel
proc = Popen(cmd, *kwargs)
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 756, in __init__
restore_signals, start_new_session)
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 1155, in _execute_child
startupinfo)
OSError: [WinError 87] The parameter is incorrect
why is my conda having this issue?
Traceback (most recent call last):
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packagestornado\web.py", line 1703, in _execute
result = await result
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packagestornado\gen.py", line 742, in run
yielded = self.gen.throw(exc_info) # type: ignore
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packages\notebook\services\sessions\handlers.py", line 69, in post
model = yield maybe_future(
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packagestornado\gen.py", line 735, in run
value = future.result()
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packagestornado\gen.py", line 742, in run
yielded = self.gen.throw(exc_info) # type: ignore
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 88, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packagestornado\gen.py", line 735, in run
value = future.result()
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packagestornado\gen.py", line 742, in run
yielded = self.gen.throw(exc_info) # type: ignore
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 100, in start_kernel_for_session
kernel_id = yield maybe_future(
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packagestornado\gen.py", line 735, in run
value = future.result()
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packagestornado\gen.py", line 209, in wrapper
yielded = next(result)
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(kwargs)
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packages\jupyter_client\multikernelmanager.py", line 158, in start_kernel
km.start_kernel(kwargs)
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packages\jupyter_client\manager.py", line 301, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(*kw)
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packages\jupyter_client\manager.py", line 248, in pre_start_kernel
self.write_connection_file()
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packages\jupyter_client\connect.py", line 468, in write_connection_file
self.connection_file, cfg = write_connection_file(self.connection_file,
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packages\jupyter_client\connect.py", line 138, in write_connection_file
with secure_write(fname) as f:
File "c:\users\user\anaconda3\envstensorflow1\lib\contextlib.py", line 113, in __enter__
return next(self.gen)
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packages\jupyter_core\paths.py", line 435, in secure_write
win32_restrict_file_to_user(fname)
File "c:\users\user\anaconda3\envstensorflow1\lib\site-packages\jupyter_core\paths.py", line 361, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed while importing win32api: The specified module could not be found.
I'm trying to run an object detection API but failed due to a "failed to start kernel" error i'm getting
I'd appreciate anyone's help.
@Sashdesigns - This looks like a duplicate of #5090 although your jupyter_client and jupyter_core packages appear relatively up to date, so I'd focus on the pywin32 aspect of things.
Most helpful comment
This is more like #3481. The file that can't be found is most likely the one referenced as the first item in the
argvstanza/array of the kernel.json file corresponding to the kernel that you're attempting to start. As noted in the referenced issue, you should be able to usejupyter kernelspec listto help locate the appropriate kernel.json file.Whatever command appears in that item, ensure it is valid relative to your environment.