Notebook: Failed to start the kernel Unhandled error

Created on 29 Nov 2019  路  7Comments  路  Source: jupyter/notebook

Traceback (most recent call last):
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\tornado\web.py", line 1699, in _execute
result = await result
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(exc_info) # type: ignore
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\notebook\services\sessions\handlers.py", line 72, in post
type=mtype))
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(
exc_info) # type: ignore
File "C:\Users\miisa\AppData\Roaming\Python\Python37\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\miisa\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\notebook\services\sessions\sessionmanager.py", line 101, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(kwargs)
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(
kwargs)
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "C:\Anaconda3\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 100, in secure_write
win32_restrict_file_to_user(fname)
File "C:\Users\miisa\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 53, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed: The specified procedure could not be found.

Most helpful comment

Try running conda install pywin32, then upgrading jupyter_client to 5.3.4 (e.g., pip install jupyter_client --upgrade) which should also upgrade jupyter_core to 4.6.1.

All 7 comments

Try running conda install pywin32, then upgrading jupyter_client to 5.3.4 (e.g., pip install jupyter_client --upgrade) which should also upgrade jupyter_core to 4.6.1.

Thank you! After 4 hrs of trying, you saved me.

Thank you, Kevin-bates. The solution you suggested worked for me in resolving the Kernel Error I got while running Jupyter notebook.

Glad to hear this. I think we can close this issue now.

Traceback (most recent call last):
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packages\tornado\web.py", line 1703, in _execute
result = await result
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(exc_info) # type: ignore
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packages\notebook\services\sessions\handlers.py", line 69, in post
model = yield maybe_future(
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(
exc_info) # type: ignore
File "C:\Users\susha\AppData\Roaming\Python\Python38\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\susha\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(exc_info) # type: ignore
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packages\notebook\services\sessions\sessionmanager.py", line 100, in start_kernel_for_session
kernel_id = yield maybe_future(
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\susha\AppData\Roaming\Python\Python38\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 "C:\Users\susha\AppData\Roaming\Python\Python38\site-packagesjupyter_client\multikernelmanager.py", line 186, in start_kernel
km.start_kernel(
kwargs)
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packagesjupyter_client\manager.py", line 304, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(
*kw)
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packagesjupyter_client\manager.py", line 251, in pre_start_kernel
self.write_connection_file()
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packagesjupyter_client\connect.py", line 468, in write_connection_file
self.connection_file, cfg = write_connection_file(self.connection_file,
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packagesjupyter_client\connect.py", line 138, in write_connection_file
with secure_write(fname) as f:
File "C:\ProgramData\Anaconda3\lib\contextlib.py", line 113, in __enter__
return next(self.gen)
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packagesjupyter_core\paths.py", line 435, in secure_write
win32_restrict_file_to_user(fname)
File "C:\Users\susha\AppData\Roaming\Python\Python38\site-packagesjupyter_core\paths.py", line 361, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed while importing win32api: %1 is not a valid Win32 application.

I AM GETTING THIS ERROR EVEN AFTER TRYING @kevin-bates SOLUTION

Name Version Build Channel

jupyter 1.0.0 py38_7
jupyter_client 6.1.6 py_0
jupyter_console 6.1.0 py_0
jupyter_core 4.6.3 py38_0
jupyterlab 2.1.5 py_0
jupyterlab_server 1.2.0 py_0
pywin32 227 py38he774522_1
pywin32-ctypes 0.2.0 py38_1000
pywinpty 0.5.7 py38_0

CAN ANYBODY HELP ME !!!!

Try running conda install pywin32, then upgrading jupyter_client to 5.3.4 (e.g., pip install jupyter_client --upgrade) which should also upgrade jupyter_core to 4.6.1.

IT worked

Thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonatanblue picture jonatanblue  路  3Comments

harshinielath picture harshinielath  路  3Comments

itoed picture itoed  路  3Comments

arbaazsama picture arbaazsama  路  3Comments

mmngreco picture mmngreco  路  3Comments