Skip to content

Kernel crashes

Rich Chiodo edited this page Jul 28, 2022 · 16 revisions

Jupyter Kernels can crash for a number of reasons (incorrectly installed or incompatible packages, unsupported OS or version of Python, etc) and at different points of execution phases in a notebook. The two distinct phases are Starting a Kernel for the first time and Running a cell after a kernel has been started. This page categorizes failures in to the above two categories to aid users in identifying causes for kernel crashes with the intention of being able to address those issues.

Some cells run successfully, however Kernel crashes after running another Cell

It has been observed that the most common cause (if not the only cause) of failures for random kernel crashes after it has started is due to incorrectly installed packages. For instance we've found that kernels can crash if tensorflow has been incorrectly installed.

Link to solution Symptom Example Issues
Kernel crashes when using tensorflow Kernel dies when loading any tensorflow code #7600
Kernel crashes when using numpy Kernel dies when using numpy or potentially when using other code that uses numpy #9283
Kernel crashes when using fastparquet Kernel dies when transforming types into parquet #9368
Kernel crashes when using ibm-db Kernel dies when connecting to the db #9347

Cannot run a single cell (Kernel fails to start)

Below are some of the most common issues & solutions resulting in failures to start a kernel (hence inability to run a cell):

Link to solution Symptom Example Issues
IPyKernel and other dependencies are not installed Kernel fails to start with an error about ipykernel not being installed #2626 #3800
Outdated version of IPython Messages about missing modules when starting.
Outdated version of IPyKernel Messages about missing modules when starting. #10797
Failure to start kernel due to missing package pip IPykernel will fail to be found and attempting to install it will fail with an error about pip missing. #10400
Failure to start kernel when using Conda Environments Kernel will fail to start with potentially a message about conda failing to initialize. #10681 #10856 #2422
ipykernel & other dependencies are installed, yet I am asked to install these dependencies User is asked to install ipykernel over and over again #6644 #9416 #6272
Built in modules overridden by user code Kernel fails to start with functions not being available. #8058 #7522
Module not installed Kernel fails with Module not found messages.
Failure to import modules Kernel fails to start with Module not found messages.
Dll load failures Kernel fails to start with DLL load failures #2446
Errors with Win32api module Kernel fails to start with specific DLL load failures
Errors with pyzmq module Kernel fails to start with zmq related functions missing.
Kernels fail to start as ports are blocked Kernel fails to start with errors about ports not usable
Cell fails to complete execution when using IPython 8.0 and pygments < 2.4.0 Kernel fails to start with 'process_carriers' not defined. #8786

Notes:

  • All error information can be found in the Jupyter output panel accessed via the the command Jupyter: View Outupt.
  • When installing packages always consider using %pip install instead of !pip install in the cells.
  • When installing packages into conda environments consider using %conda install instead of !conda install in the cells.
  • Always activate the terminal with the environment associated with the Kernel.

Known issues
Please up-vote these issues to help us prioritize getting these addressed.

  • A full list of all known issues can be found here.
  • The OCAML kernel does not work (#8897)
  • Kernels using 32-bit Python environments installed via conda does not work (#9134)
  • xeus Python kernel is currently not supported (hence hidden) (#5469)
Clone this wiki locally