notebook: Persistent kernel error

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.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

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.

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