jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.69k stars 4.93k forks source link

Unhandled error in Jupyter Kernel #4914

Open Surya1208 opened 5 years ago

Surya1208 commented 5 years ago

I was initially getting a pip3 installation error.To solve that i deleted all the files under ~./local/

After deleting those files, pip3 started working. But i am getting the below unhandled error in the jupyter kernel

Traceback (most recent call last): File "/jhub/lib/python3.6/site-packages/tornado/web.py", line 1592, in _execute result = yield result File "/jhub/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run value = future.result() File "/jhub/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run yielded = self.gen.throw(exc_info) File "/jhub/lib/python3.6/site-packages/notebook/services/sessions/handlers.py", line 73, in post type=mtype)) File "/jhub/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run value = future.result() File "/jhub/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run yielded = self.gen.throw(exc_info) File "/jhub/lib/python3.6/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 "/jhub/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run value = future.result() File "/jhub/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run yielded = self.gen.throw(*exc_info) File "/jhub/lib/python3.6/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 "/jhub/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run value = future.result() File "/jhub/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper yielded = next(result) File "/jhub/lib/python3.6/site-packages/notebook/services/kernels/kernelmanager.py", line 160, in start_kernel super(MappingKernelManager, self).start_kernel(kwargs) File "/jhub/lib/python3.6/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel km.start_kernel(kwargs) File "/jhub/lib/python3.6/site-packages/jupyter_client/manager.py", line 240, in start_kernel self.write_connection_file() File "/jhub/lib/python3.6/site-packages/jupyter_client/connect.py", line 472, in write_connection_file kernel_name=self.kernel_name File "/jhub/lib/python3.6/site-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: '/home/u28225/.local/share/jupyter/runtime/kernel-d3b1e35b-623d-41d0-96c4-9b04475acd87.json'

Can you help me in solving this error?

kevin-bates commented 5 years ago

Hi @Surya1208, I can reproduce this issue if I remove the runtime directory while notebook server is running. Any subsequent attempts to start a kernel, within that server's instance, fail with the inability to write the connection file.

Restarting the Notebook server should recreate the appropriate runtime directory structure and kernel start requests should then be honored.

If you find the restart resolves your issue, could you please close this issue? Otherwise, we'll need to continue looking into this.

Thanks.