Last answered:

27 Oct 2022

Posted on:

25 Oct 2022

0

Kernel error in Jupyter notebook

Good evening. I can't run the notebook because of a "kernel error". I'll paste here the message. Can you help me? Thank you

Traceback (most recent call last):
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\tornado\web.py", line 1713, in _execute
    result = await result
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\asyncio\tasks.py", line 318, in __wakeup
    future.result()
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\tornado\gen.py", line 776, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\notebook\services\sessions\handlers.py", line 77, in post
    type=mtype))
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\tornado\gen.py", line 769, in run
    value = future.result()
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\tornado\gen.py", line 776, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\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 "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\tornado\gen.py", line 769, in run
    value = future.result()
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\tornado\gen.py", line 776, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 111, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\tornado\gen.py", line 769, in run
    value = future.result()
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\asyncio\futures.py", line 181, in result
    raise self._exception
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\asyncio\tasks.py", line 249, in __step
    result = coro.send(None)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\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 "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\utils.py", line 30, in wrapped
    raise e
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\utils.py", line 27, in wrapped
    return loop.run_until_complete(future)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\nest_asyncio.py", line 89, in run_until_complete
    return f.result()
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\asyncio\futures.py", line 181, in result
    raise self._exception
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\asyncio\tasks.py", line 249, in __step
    result = coro.send(None)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\multikernelmanager.py", line 214, in _async_start_kernel
    starter = ensure_async(km.start_kernel(**kwargs))
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\utils.py", line 30, in wrapped
    raise e
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\utils.py", line 27, in wrapped
    return loop.run_until_complete(future)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\nest_asyncio.py", line 89, in run_until_complete
    return f.result()
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\asyncio\futures.py", line 181, in result
    raise self._exception
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\asyncio\tasks.py", line 249, in __step
    result = coro.send(None)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\manager.py", line 83, in wrapper
    raise e
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\manager.py", line 75, in wrapper
    out = await method(self, *args, **kwargs)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\manager.py", line 389, in _async_start_kernel
    await ensure_async(self._launch_kernel(kernel_cmd, **kw))
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\utils.py", line 30, in wrapped
    raise e
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\utils.py", line 27, in wrapped
    return loop.run_until_complete(future)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\nest_asyncio.py", line 89, in run_until_complete
    return f.result()
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\asyncio\futures.py", line 181, in result
    raise self._exception
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\asyncio\tasks.py", line 249, in __step
    result = coro.send(None)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\manager.py", line 307, in _async_launch_kernel
    connection_info = await self.provisioner.launch_kernel(kernel_cmd, **kw)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\provisioning\local_provisioner.py", line 204, in launch_kernel
    self.process = launch_kernel(cmd, **scrubbed_kwargs)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\launcher.py", line 170, in launch_kernel
    raise ex
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\site-packages\jupyter_client\launcher.py", line 158, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Alessandro\anaconda3\envs\py3-TF2.0\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)
NotADirectoryError: [WinError 267] Nome di directory non valido

6 answers ( 0 marked as helpful)
Instructor
Posted on:

26 Oct 2022

0

Hi Alessandro,

When does this error appear, what portion of the code are you running?
Just to be sure, did you install the required packages?

Best,
Nikola, 365 Team

Posted on:

26 Oct 2022

0

Good morning. The error appears just when I open the notebook. Usually I have a different error ("not connected") that I already reported several times in the Q&A section of other courses, but nobody has ever helped me. This time I have this:
image.png
When I click on "Kernel error", it gives me the message I pasted before.
Yes, I have installed the required packages. Thanks

Instructor
Posted on:

26 Oct 2022

0

Hi Alessandro,

I have no concrete solution to this problem, but to me it looks like some kind of problem with your environment.
Maybe it wasn't installed and configured properly, or it is not selected as the environment in the notebook.

So, try to reinstantiate a different environment and check for related issues.

Here's an article I found on the internet about kernel errors, you can check it out:
https://towardsdatascience.com/how-to-fix-kernel-error-in-jupyter-notebook-81619e195703#:~:text=A%20kernel%20error%20occurs%20basically,a%20specific%20version%20of%20Python

Hope this was useful in some way, even though I couldn't help you with the problem directly!

Best,
Nikola, 365 Team

Posted on:

26 Oct 2022

0

Maybe I have already tried with the procedure in that link, but I'll try again. Thank you

Posted on:

27 Oct 2022

0

Good morning. I have tried it, but it gives me an error when I write "conda install ipykernel". I post the error here:
Collecting package metadata (current_repodata.json): failed

CondaSSLError: Encountered an SSL error. Most likely a certificate verification issue.

Exception: HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/main/win-64/current_repodata.json (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))

Posted on:

27 Oct 2022

0

I think I have solved the issue by myself (even if I already tried this solution in the past and it didn't work): the path name of the notebook I was using was too long, so I copied and pasted it in a shorter path and now the error has disappeared. In general, it could also be useful for someone with a "kernel error" to watch this video: https://www.youtube.com/watch?v=m0TLwkje6co&ab_channel=JonathanSoma

Submit an answer