United States · Grade 9 to college · Jupyter Notebook

Jupyter Notebook errors, explained for students

If your high school data science unit or college statistics lab runs in Jupyter, you have probably seen it fail in ways a plain Python file never does. The server will not start, the kernel dies, a package you just installed cannot be found, or a notebook that worked last night throws a NameError today. Each of those has a known cause. This guide pairs every symptom with what the Jupyter and IPython documentation says about it, plus the exact message from our own runs where we reproduced one.

Live teaching since 2020 · 10,000+ students · Python and data science for teens and adults

In short

Most Jupyter Notebook errors come from one of four places: Jupyter itself is not on your PATH, the kernel points at a Python that no longer exists, a package was installed into a different environment from the kernel, or cells were run out of order. Use %pip install inside the notebook, check jupyter kernelspec list, and test with Restart and run all. Modern Age Coders teaches Python and data science live to teens and adults, in a batch or one to one.

Learn it with a teacher

Three courses that use notebooks properly

Each one works in notebooks, taught live by a regular teacher who can see your screen.

Error map

Find your Jupyter error: symptom, cause, first fix

Start with the row that matches what you see. Each one is explained below with its source.

Jupyter Notebook errors and first fixes (our table, built from the Jupyter and IPython documentation and our runs)
What you seeUsual causeFirst thing to try
"jupyter" is not recognized, or command not foundJupyter is not installed, or not on PATHInstall it, or reinstall Anaconda with default settings
The page will not load in the browserBrowser extension, security software, or the addressTry another browser; swap localhost and 127.0.0.1
A cell shows a star and never runsThe kernel did not startRun jupyter kernelspec list and check the kernel path
ModuleNotFoundError: No module named ...Package installed in a different environment from the kernelRun %pip install in a notebook cell, then restart the kernel
FileNotFoundError: [Errno 2] No such file or directoryThe working folder is not where the file isPrint os.getcwd() and fix the path
NameError: name ... is not definedCells run out of order, or the kernel restartedRestart, then run all cells from the top
It worked an hour ago, now nothing importsA new file in your folder shares a module nameRename your file, as the Jupyter docs advise
ImportError: DLL load failed (Windows)pywin32 not installed correctlypip install --upgrade pywin32, as the docs show

Built from Jupyter’s What to do when things go wrong page, Running the Notebook and the IPython documentation, all read 17 October 2026. We are not connected with Project Jupyter.

It will not start

When Jupyter will not start, or will not load in the browser

Jupyter is two things: a server that runs on your computer and a page in your browser that talks to it. A failure at either end looks like "Jupyter is broken", so test them one at a time.

  1. Start it from a terminal. The Jupyter docs suggest that if a menu shortcut or the Anaconda launcher fails, you should "try opening a terminal or command prompt and running the command jupyter notebook."
  2. If the command is not found, Jupyter is missing or your PATH is not set. The docs say you may need to configure your PATH, or simply reinstall Anaconda with the default settings so it sets PATH for you.
  3. If it says it cannot find notebook, "check with pip or conda that the notebook package is installed." With pip, the classic install command in the docs is pip3 install jupyter.
  4. Try the hyphen. The docs note that jupyter-notebook, with a hyphen, is the real launcher, and jupyter notebook wraps it.
  5. Read the terminal output. A working server prints its address, by default http://localhost:8888, and the line "Use Control-C to stop this server and shut down all kernels (twice to skip confirmation)."
  6. If the browser page fails, try another browser, disable extensions, and, as the docs suggest, "try changing between localhost and 127.0.0.1."
  7. If port 8888 is busy, Jupyter picks the next free port on its own, so read the address it prints; you can also choose one with jupyter notebook --port 9999.

Where the server starts matters

The dashboard lists the notebooks, files and folders in the directory where the server was started. Start Jupyter in a folder that does not contain your class work and the class notebooks simply will not appear in the list.

The Jupyter docs recommend starting the server in the highest folder that contains your notebooks, which is often your home directory.

Closing the tab is not closing Jupyter

The notebook documentation says the kernel "remains active if the web browser window is closed", and reopening the notebook reconnects to the same kernel, with its variables still in memory.

That is convenient, and it is also why a notebook can seem to work in one session and fail in a fresh one. To stop everything, press Control-C in the terminal running the server.

The kernel

Kernel errors: what a kernel is, and why it will not start

The Jupyter documentation describes a kernel as the program that "holds the data and objects you create with your notebook code". When it will not start, cells sit with a star next to them and nothing happens.

Check which kernels Jupyter knows about

Files called kernel specs tell Jupyter how to start each kernel. Run jupyter kernelspec list in a terminal to see where they live.

A Python kernel whose path ends in ipykernel/resources is the built-in default, which runs in the same environment as the notebook server. The docs say that if a python3 kernelspec points somewhere else and fails, deleting or renaming that folder exposes the default.

Check the path inside kernel.json

Each kernel spec has a kernel.json file with an argv stanza: the exact command used to launch the kernel. After a Python reinstall, it often points at a Python that is no longer there.

On Windows, the docs add, Python commands live in a Scripts folder rather than bin, and a path missing its .exe extension typically ends in a FileNotFoundError.

Kernel commands from the IPython and Jupyter documentation, and when a student needs each
CommandWhat it doesWhen you need it
jupyter kernelspec listLists every kernel spec and its folderThe kernel will not start, or the wrong Python runs
python -m ipykernel install --userRegisters the current Python as a kernelYou made a new environment and it is missing from the menu
--name myenv --display-name "Python (myenv)"Gives that kernel its own name in the menuYou have several environments for different classes
Kernel, Interrupt (or i, i)Stops a cell that is taking too longA loop never ends
Kernel, Restart (or 0, 0)Starts the whole computation freshAnything strange, and before you submit work

The IPython documentation notes that the --name value is used internally and that these commands "will overwrite any existing kernel with the same name", so give each environment a distinct name. On Windows, a broken pywin32 install shows up in a traceback ending with the line ImportError: DLL load failed: The specified module could not be found. The Jupyter docs give pip install --upgrade pywin32 as the first fix to try.

No module named

ModuleNotFoundError in Jupyter: installed, but not where the kernel looks

This one causes a lot of confusion: you ran pip install, it said success, and the notebook still cannot import the package. The Jupyter docs name the cause: the Notebook server running in one environment while the kernel comes from another.

Fixed · install from inside the notebookpython
# In a notebook cell (IPython magic, documented):
%pip install seaborn

# This installs into the environment of the kernel
# that runs this notebook, which is the one that
# matters. Then restart the kernel and import:
import seaborn

# Before, our run printed:
# ModuleNotFoundError: No module named 'seaborn'

The IPython documentation describes %pip as a magic that will "Run the pip package manager within the current kernel." That is the point: it installs where the notebook actually runs. %conda does the same for conda environments.

Why pip in a terminal can miss

A terminal's pip belongs to whichever Python comes first on PATH. If the notebook kernel uses Anaconda and the terminal uses a python.org install, or the other way round, the package lands in the wrong place.

The Jupyter docs list the signs: import statements within code cells producing ImportError or ModuleNotFound exceptions, or nothing happening when you try to run a cell.

How to check in ten seconds

Run import sys and then print(sys.executable) in a notebook cell. That is the Python the kernel uses. Compare it with the Python your terminal uses before installing anything else.

If you work across several environments, register each one as its own kernel with python -m ipykernel install, then pick the right one from the notebook's kernel menu.

Cell order and files

NameError and FileNotFoundError: the notebook remembers more than you think

A notebook is a sequence of cells, and each one runs on Shift-Enter in whatever order you press it. The kernel keeps every variable until it restarts. That flexibility causes two classic notebook errors.

Broken · a cell used before it was definedpython
# Cell A, run first by mistake (ours)
print(average)

# Cell B, written above but not run yet
average = 91.5

# Our run of the same two lines as a script:
# NameError: name 'average' is not defined

In a notebook this often works for hours, because the variable was set earlier in the session, then fails the moment the kernel restarts or a teacher opens the file fresh.

The test · restart, then run all from the toppython
# The test that catches it (ours):
# Kernel, Restart (or press 0, 0 in command mode),
# then run every cell from the top.

average = 91.5      # cell 1: define first
print(average)      # cell 2: use after

# If a notebook only works when cells are run in a
# special order, it does not work yet.

We ask students to do this before every submission. A notebook that survives Restart and run all will work on the grader's computer too.

Fixed · finding where the notebook looks for filespython
# Where is the notebook looking for files? (ours)
import os
print(os.getcwd())          # the working folder
print(os.listdir())         # what is in it

import pandas as pd
df = pd.read_csv("grades.csv")
# Our run, when grades.csv was elsewhere:
# FileNotFoundError: [Errno 2] No such file or
#   directory: 'grades.csv'
# Fix: move the file next to the notebook,
# or give the path from the folder printed above.

Print the working folder instead of guessing it. A data file sitting in Downloads is invisible to a notebook working somewhere else until you move the file or give its full path.

The file that breaks imports: "This Worked An Hour Ago"

The Jupyter docs describe a student-shaped mistake: a file in your notebook folder named after a real module. Their example is a random.py that leads to AttributeError: module 'random' has no attribute 'sample' deep inside the kernel's own imports.

Their advice is direct: "You’ll need to rename your file." Avoid naming files after anything you import: random, math, pandas, csv or test files called the same as a library.

Notebook files are JSON

The notebook documentation says notebooks "are internally JSON files and are saved with the .ipynb extension." Editing one in a plain text editor, or a merge in Git, can break that JSON so the file will not open.

Keep a copy before experimenting, and if a notebook will not open after editing it by hand, the JSON is the first suspect.

A routine

Nine steps for any Jupyter problem

Our routine, in the order our teachers use it with students. It keeps you from reinstalling everything when one line would do.

  1. Read the last line of the traceback. It names the error type. The lines above show where it happened.
  2. Decide which half failed: the server (terminal shows errors, browser page will not load) or the kernel (page loads, cells will not run).
  3. For the server, start it from a terminal and read what it prints.
  4. For the kernel, run jupyter kernelspec list and check that the path in kernel.json exists.
  5. For imports, print sys.executable in a cell, then install with %pip from inside the notebook.
  6. For files, print os.getcwd() and os.listdir() and compare with where the file really is.
  7. For strange results, restart the kernel and run all cells from the top.
  8. Check your folder for files named after modules, such as random.py, and rename them.
  9. Only then reinstall. The Jupyter docs suggest updating relevant packages first, because a fixed bug may already be waiting.

Command mode and edit mode

The notebook docs list Esc for command mode and Enter for edit mode. Shortcuts like 0, 0 to restart only work in command mode, which confuses many first-time users.

School laptops

If your school manages the laptop, you may not be allowed to install anything. Ask the teacher which environment the class expects before changing PATH or installing Anaconda.

Asking for help well

The Jupyter docs point to the Jupyter Discourse forum and Stack Overflow. Post the full traceback and your exact command; a screenshot of a red box alone rarely gets answered.

Beyond the error

Learning to work in notebooks, not just survive them

Notebooks reward a few habits that nobody teaches in a syllabus. This is how our teachers build them across a first term of data science.

Notebook habits across a first term (our plan for Grade 9 to college, adjusted for each learner)
ClassesWhat the student buildsThe habit it teaches
1 to 2A notebook of small experimentsCells, Shift-Enter, markdown notes
3 to 4Loading a CSV with pandasPaths and the working folder
5 to 6Cleaning and charting dataOne idea per cell; restart and run all
7 to 8A project with extra packagesEnvironments, kernels and %pip
9 to 10A short data storyWriting for a reader, not just the grader
11 to 12Sharing and presentingClean outputs, reproducible from the top

We teach the concepts so students can complete their own class notebooks; we never fill in graded work. For bugs that are not about Jupyter at all, see how to debug code, and for a wider view of the subject, our data science course page.

Where a student is

Four stages of working in Jupyter

From copying cells to running reliable analyses.

Stages of notebook skill (ours)
StageWhat it looks like
1. ClickerRuns cells top to bottom without knowing what each holds
2. ExplorerRuns cells in any order and gets surprising results
3. Tidy workerRestarts and runs all before trusting a result
4. AnalystBuilds notebooks that anyone can rerun and follow

For parents

If your teenager says the notebook "worked yesterday", that is stage 2, and it is normal. The fix is a habit, not a new laptop.

The same habits carry over to any later course that hands out its work as notebooks.

For students

Before you submit, restart the kernel and run all. If it breaks, you found the bug before your teacher did.

Install packages with %pip from inside the notebook. It goes where the kernel can see it.

The catalogue

Nine courses for data and Python

Live online classes with a regular teacher, in a batch or one to one.

I

Teens

Ages 13 to 18

JNE / TEN / 01

Data science for teens

Pandas, charts, first models.

Open the syllabus
II

Bridging

Ages 13 and up

JNE / BRG / 02

Python certification prep

PCEP and PCAP, ages 13 and up.

Open the syllabus

JNE / BRG / 03

Git and GitHub for teens

Versioning notebooks safely.

Open the syllabus
III

College and adults

Ages 18 and up

JNE / PRO / 01

Data science, complete

Statistics to machine learning.

Open the syllabus

JNE / PRO / 03

Python, zero to advanced

For college students and adults.

Open the syllabus

How lessons run

Live classes around a US school or college week

Weekdays or weekends, flexible: choose your batch, or for a very personalised plan choose 1-on-1 at your convenience, weekend mornings or weekdays.

Weekdays

Evening batches for US time zones.

Weekends

Longer sessions for projects.

1-on-1

Fitted around classes and labs.

The same teacher

Week after week.

Your own setup

We fix it on your machine.

Shared screen

We see the notebook you see.

Ideas, not answers

Your graded work stays yours.

Every state

Online, from home or dorm.

Group or private

Fifteen to twenty, or one student.

Student work

Projects from our Python and data students

Built by learners who started with a notebook that would not run. More on the student labs page.

NutriLife AI nutrition coach project screenshot

AI and ML

NutriLife

An AI nutrition coach that reads what you eat and works you toward a target.

by Bhavya · Open it

Misti AI chatbot for maths and coding screenshot

AI and ML

Misti

A chatbot that answers mathematics and programming questions, built and deployed by a student.

by Harshit · Open it

GuardianX AI internet safety assistant screenshot

AI and ML

GuardianX

An assistant that helps a young person recognise unsafe situations online.

by Vivaan · Open it

SkyCast weather forecast application screenshot

Web app

SkyCast

A weather forecasting site with live conditions for any location.

by Krish

Fees

Fees

Jupyter is free and open source. What you pay for is a teacher: monthly fees shown in US dollars, no contract for the whole semester, and you can stop at the end of any month.

Free first class

USD 0

no card required

  • A free first lesson
  • Bring the notebook that fails
  • No card needed
Book it

Group batch

USD 100

a month, billed in US dollars

  • Fifteen to twenty students
  • One regular teacher
  • A batch time you pick
  • Paid each month
Start here

One to one

USD 150

a month, billed in US dollars

  • Private lessons
  • Scheduled at your convenience
  • Your own data and projects
Enquire

What families say

Rated 4.9 across 547 Google reviews

Reviews parents left on Google, quoted as written.

★★★★★

"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."

Ria Mukherjee

Parent

★★★★★

"Modern Age Coders has been a game-changer for me. I struggled to grasp IT concepts and coding before joining, but their classes transformed everything. I can now confidently write complex programs with ease."

Samriddha Mondal

Student

★★★★★

"One of the most wonderful education centres out there. Education is not limited to school syllabus but focuses on skill development."

Vansh Agarwal

Student

★★★★★

"My child Dhairya is really enjoying the Modern Age Coders classes. This is his first online class and he eagerly looks forward to it. I can already see his improvement, and the teachers are very cooperative."

Sonam Oswal

Parent of Dhairya

★★★★★

"Modern Age Coders have wonderful teachers who teach in a clear, easy and practical way. The teacher boosts students' confidence and inspires them to learn without hesitation."

Sonu Goyal

Parent

★★★★★

"I highly recommend this computer coding class! The teachers are incredibly knowledgeable and passionate about coding."

Ritu Kedia

Parent

Questions students ask

Jupyter Notebook errors: common questions

Why is Jupyter Notebook not working?

Find which half failed. If the terminal shows an error or the command is not found, the server or install is the problem. If the page loads but cells will not run, the kernel is. The Jupyter docs suggest running jupyter notebook from a terminal first.

How do I fix "No module named" in Jupyter?

Install the package from inside the notebook with %pip install followed by the package name, then restart the kernel. That installs into the environment the kernel uses, which is often not the one your terminal uses.

Why does Jupyter say the kernel cannot start?

Usually the kernel spec points at a Python that no longer exists. Run jupyter kernelspec list, open kernel.json in the folder it shows, and check that the path in argv exists. Re-registering the kernel with python -m ipykernel install, as the IPython docs describe, is the standard repair.

Why do I get FileNotFoundError in Jupyter?

The notebook is looking in its own folder and the file is somewhere else. Print os.getcwd() to see the folder, then move the file there or use the correct path.

Why did my notebook stop working after a restart?

Cells were run out of order before, so variables existed that a fresh run never creates. Restart the kernel and run all cells from the top, then fix the first cell that fails.

How do I stop a cell that runs forever?

Use the Kernel menu and choose Interrupt, or press i twice in command mode. If that fails, restart the kernel.

Is Jupyter Notebook free?

Yes. The Jupyter documentation says Jupyter software is free and open-source, and it can be installed with pip or with the Anaconda distribution.

Will you do my class notebook for me?

No. We teach the ideas so you can finish your own notebook, and we never complete graded assignments. A teacher will help you find and fix the error yourself.

What times are classes for US students?

Weekdays or weekends, flexible. Choose your batch, or for a very personalised plan choose 1-on-1 at your convenience, weekend mornings or weekdays.

How much do data science classes cost?

The first lesson is free. Then you pay monthly for live teaching, and this page's fees section lists the monthly figure in US dollars.

Elsewhere on this site

Related pages

More for US students working with Python and data.

Coding classes in the USA

All our pages written for US learners.

Data science course

What a full course covers.

AI and ML classes in the USA

For students moving on to models.

How to debug code

A method for any bug.

Files in Python

Paths, reading and writing.

Python for 16 year olds

A starting point in high school.

Python indentation errors explained

Every Python IndentationError message, what it means, and how to fix it.

Python turtle not working

Python turtle not working? The real errors, the fixes, and how to write text.

Scratch not working

Scratch not working? Saving, sign-in, school network and tablet fixes, from the Scratch Help Center.

Start here

Book a free first lesson

Tell us which class or project the notebook belongs to and what error it shows. In the first lesson the teacher works through it with you.

If you want to see the approach first, read how our lessons run, or open the course catalogue for full syllabuses.

WhatsApp us · +91 91233 66161 · connect@modernagecoders.com

Everything happens on live video, and the teachers are based in India, so there is no campus to visit. For US students, WhatsApp is usually the quickest way to reach us.

The first lesson is on us, and we never ask for a card.

Want a class sooner? Book a priority demo

A priority demo is a full class of about 45 to 60 minutes. After the class the mentor sends a written skill report and a personal learning roadmap on WhatsApp. If you enrol, the demo fee is adjusted against your first month's fee. Share your demo Order ID with us on WhatsApp and we take it off.

Book a priority demo

Keep exploring Modern Age Coders

Related courses and guides

Free resources

From the blog

Start here

Free classPriority demoCall us