Jupyter Notebook

How to Fix Jupyter Notebook Error: Kernel Failed to Start Due to Missing Module

Jupyter Notebook is a great software to learn or try the programs and codes from a web browser. If you’re a Jupyter Notebook user, you might face problems with it once in a while. After a system update or due to some other unknown reasons, your Jupyter Notebook kernel might fail to start.

You might see an error message like “The kernel failed to start due to the missing module ‘x’…” as shown in the following screenshot. If you’ve seen this error message, it means that the Jupyter Notebook server can’t start because it’s missing some Python modules that you haven’t installed. Maybe you had that installed, but a system upgrade uninstalled it. Maybe you’ve removed the dependency module by mistake or the module was removed due to some other unknown reasons. To fix this error, all you have to do is find the missing module and install it on your computer.

A screenshot of a computer program Description automatically generated

In this article, we will show you how to fix the Jupyter Notebook “kernel failed to start due to missing module” error.

Topic of Contents:

  1. Finding the Jupyter Notebook’s Missing Kernel Module
  2. Installing the Jupyter Notebook’s Missing Kernel Module
  3. Conclusion

Finding the Jupyter Notebook’s Missing Kernel Module

You don’t have to go very far to find the Python module that you need to install to fix the Jupyter Notebook’s “kernel failed to start due to the missing module” error. The missing module name is printed in the error message as well.

As you can see, the missing Python module name in our case is “packaging”. So, all we have to do is install the Python “packaging” module with pip or conda (if you’re using Anaconda Python) command.

A screenshot of a computer program Description automatically generated

Installing the Jupyter Notebook’s Missing Kernel Module

You can install the missing Jupyter Notebook’s dependency module (“packaging” in our case) with the following command if you’re using the official Python programming language:

$ pip install -U --force-reinstall packaging

or

$ pip3 install -U --force-reinstall packaging

You can install the missing Jupyter Notebook’s dependency module (“packaging” in our case) with the following command if you’re using the Anaconda Python distribution:

$ conda install --force-reinstall packaging

We are using the official Python programming language, so we issued the first command to reinstall the missing Python “packaging” module (in our case).

A screenshot of a computer Description automatically generated

The required missing Python module for Jupyter Notebook to work should be installed.

A screenshot of a computer Description automatically generated

As you can see, Jupyter Notebook is able to run the codes again. So, the issue is resolved.

A screenshot of a computer program Description automatically generated

Conclusion

In this article, we showed you how to fix the Jupyter Notebook “kernel failed to start due to missing module” error on the official Python (using pip or pip3 command) and Anaconda Python distribution (using the conda command).

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.