Installing JupyterLab and managing kernels
Notebook, JupyterLab and Notebook 7 compared, installing into a virtual environment, and why a kernel is not the same thing as an interpreter.
Three front ends, one protocol
Every Jupyter front end talks the same kernel protocol: the browser sends code, a separate process executes it and returns outputs. Which interface you install only changes the editor, not how code runs.
| Front end | Package | Best for |
|---|---|---|
| JupyterLab | jupyterlab | Daily work: tabs, split panes, terminal, file browser, extensions |
| Notebook 7 | notebook | The classic single-document UI, now built on the same components as Lab |
| VS Code / editors | built in | Notebooks next to the rest of your codebase and debugger |
| nbclassic | nbclassic | Legacy extensions only; rarely worth it on a new machine |
JupyterLab can open classic .ipynb files, so choosing Lab does not lock you out of anything.
Install into the environment that has your libraries
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install jupyterlab ipykernel numpy pandas
jupyter labInstalling Jupyter globally and your libraries in a venv is the most common way to end up with a kernel that cannot import anything you expected.
💡
A kernel is a separate process launched by Jupyter, not a thread inside the server. It inherits the interpreter that has
ipykernel installed, which is why ipykernel must live in each environment you want to use.Registering and listing kernels
# register the active environment under a readable name
python -m ipykernel install --user --name sales-analysis --display-name "Python (sales)"
jupyter kernelspec list # where each kernel points
jupyter kernelspec remove sales-analysis# verify inside a notebook which interpreter is really running
import sys
print(sys.executable)
print(sys.version)
# and where it will look for packages
print(sys.path[:3])- The kernel name is the identifier used on the command line; the display name is what the menu shows.
--userwrites to your home directory; drop it to install for all users of that Python.- In Lab, switch kernel from the kernel selector in the top-right of the notebook.
FAQ
The notebook cannot import pandas but my terminal can. Why?
You are running a different interpreter. Print
sys.executable in a cell and compare it with which python. Register a kernel from the environment that has your packages installed.Should I use conda or venv?
Either, as long as you stay consistent. conda is convenient for binary scientific packages; pip plus venv is lighter and closer to what production uses. Do not mix both managers inside one environment.
Related
Notebook fundamentals Magics: line, cell and shell commands
Last refreshed 2026-09-18.