Fixing 'Failed to start the Kernel': When the Jupyter Kernel Dies in VS Code

intermediate💻 VS Code2026-05-12| VS Code with Python/Jupyter Extension. Affects Windows, macOS, and Linux, primarily within Conda or venv virtual environments.

Error Message

Failed to start the Kernel. The Jupyter kernel died. View Jupyter log for further details.
#jupyter#python#vscode#troubleshooting#ipykernel

The Problem

You’ve written your Python scripts and they run perfectly from the terminal. But the second you hit 'Play' on a Jupyter Notebook cell in VS Code, everything falls apart. Instead of your data visualizations or print statements, you get a dead kernel and a stubborn notification in the corner of your screen.

Failed to start the Kernel. The Jupyter kernel died. View Jupyter log for further details.

The culprit is rarely your code. Instead, it’s almost always a breakdown in how your selected Python interpreter communicates with the Jupyter backend. It is a configuration headache, not a programming one.

Root Causes

In most cases, the crash stems from one of three specific failures:

  • Corrupt ipykernel: The bridge between Python and Jupyter is either missing or its binaries are broken in your current environment.
  • Version Mismatches: Low-level libraries like tornado or pyzmq have updated to versions that VS Code’s extension can’t yet handle.
  • Stale Paths: VS Code is pointing to a Python executable that was moved, renamed, or deleted during a recent update.

Step 1: The 'Force' Reinstall

Even if VS Code claims ipykernel is installed, the installation might be 'ghosted' or partially corrupted. Forcing a fresh copy is the fastest way to rule out broken binaries.

First, activate your specific environment in the terminal. Then, run the following command:

pip install --upgrade --force-reinstall ipykernel

Conda users should use the forge channel for better compatibility:

conda install -c conda-forge ipykernel --force-reinstall

Restart VS Code after the installation finishes. Often, this is all it takes to clear the error.

Step 2: Resolving Tornado and Pyzmq Conflicts

Jupyter relies on tornado for networking and pyzmq for messaging. If these are out of sync, the kernel will exit the millisecond it starts. This is common on macOS systems where system-wide updates can bump these versions unexpectedly.

Try pinning these libraries to known stable versions:

pip install "pyzmq<25" "tornado<6.3"

Specifically, pyzmq version 25.x is a frequent offender on M1/M2 Macs. Rolling back to 24.x usually restores the handshake between the notebook and the backend immediately.

Step 3: Mining the Jupyter Log

Don't ignore the error message's advice to check the logs. In VS Code, open the Output tab (Ctrl+Shift+U or Cmd+Shift+U) and switch the dropdown on the right to Jupyter.

Scan the text for a Traceback. You are looking for two specific clues:

  • ImportError: DLL load failed: A C-extension like NumPy or ZMQ is broken. You’ll need to reinstall that specific package.
  • ModuleNotFoundError: No module named 'pysqlite2': Common on Linux and WSL. You likely need to install system-level headers using sudo apt install libsqlite3-dev.

Step 4: Regenerating the Kernel Configuration

Sometimes VS Code caches the wrong path for your environment. You can force it to refresh its internal mapping with a quick 'toggle' trick:

  • Click the Kernel Name in the top-right corner of your notebook.
  • Choose Select Another Kernel > Python Environments.
  • Switch to a completely different environment (like your base Python install).
  • Run a simple print("test") cell.
  • Switch back to your original environment.

This simple swap often forces VS Code to rewrite the kernel JSON file with the correct paths.

Step 5: When All Else Fails, Rebuild

If you've spent 20 minutes chasing dependency ghosts, stop. It is more efficient to delete the environment and start fresh than to manually untangle a library knot.

# For venv
rm -rf .venv
python -m venv .venv
source .venv/bin/activate
pip install ipykernel pandas matplotlib  # Reinstall only what you need

# For Conda
conda env remove -n myenv
conda create -n myenv python=3.11 ipykernel
conda activate myenv

Verification

Run this snippet to confirm the kernel is stable and using the correct resources:

import sys
print(f"Status: Kernel Active")
print(f"Version: {sys.version.split()[0]}")
print(f"Path: {sys.executable}")

If you see your environment path without a crash popup, the fix is successful.

Pro-Tips for Prevention

To keep your notebooks running smoothly, stick to these two habits. First, always use a dedicated .venv for every project to prevent 'dependency creep' from other libraries. Second, install ipykernel as your very first step before adding heavy frameworks like PyTorch or TensorFlow, which often pin shared dependencies to rigid, incompatible versions.

Related Error Notes