ipykernel
raw JSON → 7.2.0 verified Tue May 12 auth: no python install: verified quickstart: verified
ipykernel provides the IPython kernel, which serves as the Python execution backend for Jupyter Notebooks, JupyterLab, and other Jupyter frontends. It facilitates interactive Python development, supports rich media outputs, and enables seamless code sharing within these environments. The current stable version is 7.2.0, and the project maintains an active development and release cadence.
pip install ipykernel Common errors
error ModuleNotFoundError: No module named 'ipykernel' ↓
cause The `ipykernel` package is not installed in the specific Python environment that Jupyter Notebook or JupyterLab is trying to use.
fix
Activate the desired Python environment and run
pip install ipykernel (or conda install ipykernel if using Anaconda), then register the kernel with python -m ipykernel install --user --name myenv --display-name "Python (myenv)" (replace myenv and display name as appropriate). error Kernel Died ↓
cause A generic error indicating that the Jupyter kernel failed to start or unexpectedly stopped. This can be caused by missing or incompatible dependencies (like `pyzmq`), an incorrect Python interpreter selected, a corrupted kernel specification, or resource limitations.
fix
Ensure
ipykernel is installed and registered in the correct Python environment. Check Jupyter's output logs for more specific errors. Try upgrading/downgrading pyzmq (pip install --upgrade pyzmq or pip install pyzmq==19.0.2) or tornado if dependency issues are suspected, and verify the Python executable path in the kernel configuration. error Running cells with 'Python X.Y.Z' requires the ipykernel package. ↓
cause This message, often seen in IDEs like VS Code, indicates that the selected Python interpreter for the notebook does not have `ipykernel` installed.
fix
Execute the recommended command provided by the IDE, usually
"<path_to_python_executable>" -m pip install ipykernel or simply pip install ipykernel in the activated terminal for that environment. error A connection to the notebook server could not be established. ↓
cause The Jupyter frontend cannot establish or maintain a connection with the `ipykernel` process. This can be due to network issues, port conflicts, security software interference, or a crashed kernel.
fix
Check for firewall or VPN interference. Try changing between
localhost and 127.0.0.1 in the browser URL. Ensure no other applications are using the same port. If the kernel is dying, refer to the 'Kernel Died' fix. Warnings
breaking ipykernel 7.0.0 introduced significant architectural changes for kernel subshells, including handling shell channel messages in a separate thread. While intended to be backward compatible for non-subshell users, these changes may break assumptions made by downstream libraries. Users encountering issues should consider pinning to `ipykernel < 7`. ↓
fix If issues arise, downgrade to `ipykernel < 7`. Review your code for assumptions about thread-local state or message timing. Consult the official changelog and GitHub issues for detailed migration guidance.
breaking Support for Python 3.9 was dropped in `ipykernel 7.0.0a3`. Users on Python 3.9 or older must use `ipykernel` version 6.x or earlier. ↓
fix Upgrade your Python environment to 3.10 or newer, or pin `ipykernel < 7.0.0a3` (e.g., `pip install 'ipykernel<7'`).
gotcha Version 6.30.0 contained a bug that allowed control messages to be handled concurrently, which severely broke debugging in JupyterLab and VSCode. This was a critical regression fixed in version 6.30.1. ↓
fix Ensure you are running `ipykernel` 6.30.1 or later if you were affected by this bug.
gotcha Prior to 7.1.0 (and 6.31.0 for the 6.x series), display outputs from magics like `%notebook` were not always included when saving sessions to `.ipynb` files, as `ZMQDisplayPublisher.store_display_history` defaulted to `False`. ↓
fix Upgrade to `ipykernel 7.1.0` or `6.31.0` (or newer). If using an older version, you may need to manually configure `ZMQDisplayPublisher.store_display_history` if exposed.
Install
python -m ipykernel install --user --name=myenv --display-name="Python (My Environment)" Install compatibility verified last tested: 2026-05-12
python os / libc status wheel install import disk
3.10 alpine (musl) - - 2.24s 120.1M
3.10 slim (glibc) - - 1.76s 104M
3.11 alpine (musl) - - 3.15s 104.0M
3.11 slim (glibc) - - 2.58s 112M
3.12 alpine (musl) - - 3.00s 117.3M
3.12 slim (glibc) - - 3.05s 105M
3.13 alpine (musl) - - 2.69s 117.1M
3.13 slim (glibc) - - 2.90s 104M
3.9 alpine (musl) - - 2.47s 96.4M
3.9 slim (glibc) - - 2.15s 81M
Imports
- embed_kernel
from ipykernel.embed import embed_kernel
Quickstart verified last tested: 2026-04-23
import subprocess
import sys
import os
# Ensure ipykernel is installed in the current environment
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'ipykernel'])
# Define a unique name for your kernel (e.g., based on virtual environment name)
env_name = os.environ.get('VIRTUAL_ENV', 'default_env').split(os.sep)[-1]
display_name = f"Python ({env_name.replace('_', ' ').title()} Environment)"
# Register the kernel with Jupyter
try:
subprocess.check_call([
sys.executable, '-m', 'ipykernel', 'install',
'--user', f'--name={env_name}', f'--display-name={display_name}'
])
print(f'Successfully registered Jupyter kernel: "{display_name}" (name: {env_name})')
print('To use it, launch Jupyter Notebook/Lab and select this kernel for a new notebook.')
print('You can verify installed kernels with: jupyter kernelspec list')
except subprocess.CalledProcessError as e:
print(f'Failed to register kernel: {e}')
print('Ensure Jupyter is installed (pip install notebook or pip install jupyterlab).')