JupyterLab Essentials¶
The next-generation Jupyter interface: notebooks, text editors, terminals, and data viewers in one extensible workspace. Still uses the same
.ipynbformat — everything from Jupyter applies.
Table of Contents¶
- Installation / Setup
- Core Syntax
- Common Operations
- Practical Examples
- Common Patterns
- Best Practices
- Common Mistakes
- Troubleshooting
- Related Cheat Sheets
- Official Documentation
Installation / Setup¶
Same kernels as classic notebooks (see jupyter.md for ipykernel install).
pip install jupyterlab-git jupyterlab-code-formatter jupyterlab-variableinspector
jupyter labextension list # see installed extensions
Core Syntax¶
The workspace¶
| Area | What it is |
|---|---|
| Left sidebar | File browser, running kernels/terminals, extension manager, git |
| Main area | Tabbed notebooks, editors, terminals, viewers |
| Right sidebar | Inspector (when enabled) |
| Top menu | File, Edit, View, Run, Kernel, Tabs, Settings, Help |
Everything is a dockable pane — drag tabs to split side-by-side or stacked.
Keyboard shortcuts (Command mode = Esc)¶
| Keys | Action |
|---|---|
Ctrl+Shift+P / Cmd+Shift+P |
command palette (discover everything) |
Ctrl+B / Cmd+B |
toggle left sidebar |
Esc then A / B |
insert cell above / below |
Shift+Enter |
run cell, advance |
Ctrl+Enter |
run cell, stay |
Esc then DD |
delete cell |
Ctrl+S |
save notebook |
Ctrl+Shift+D |
duplicate notebook/editor tab |
Ctrl+Shift+F |
find across open files |
Common Operations¶
File browser & multiple views¶
# Drag a notebook to the right half to watch results while editing a script on the left
# Right-click a file -> "Open With" -> Notebook / Editor / JSON viewer
Right-click → Open in new tab lets you compare a notebook with its exported script.
Terminals & consoles¶
# Left sidebar -> other -> Terminal (full shell next to your notebooks)
# Consoles give a REPL attached to the same kernel as a notebook
Data & image viewers¶
# Double-click a CSV in the file browser -> built-in data viewer
# Double-click an image / JSON / Parquet preview
# Variable inspector extension shows DataFrame shapes as you run
Git integration¶
- Install
jupyterlab-git→ Git pane in the sidebar: stage, commit, push, view diffs of.ipynband files. - For clean diffs use
nbstripout(strips outputs on commit).
Search & navigation¶
# Ctrl+Shift+F -> search across all open files
# Click an error traceback -> jumps to the file/line
# Outline pane (right side in notebook): headings + function list
Practical Examples¶
1. Notebook + script workflow¶
# 1. Write tested logic in a .py module
# 2. In JupyterLab open the module, right-click -> "Create Console for Editor"
# (or use %autoreload) to test interactively
# 3. Keep notebooks as thin, runnable narratives
2. Side-by-side experiment comparison¶
# Open two notebooks that train model A and model B
# Drag one to the right split -> run both, compare loss curves live
3. Custom extensions¶
pip install jupyterlab-plotly # interactive plotly in notebook output
pip install ipympl # interactive matplotlib widgets
pip install jupyterlab-tabular-data-editor # spreadsheet-like editing
Common Patterns¶
# Reproducible lab workspace: document the environment
# requirements: pip freeze > requirements.txt (see pip.md / uv.md)
# Server on a remote box, browse locally
# jupyter lab --no-browser --port=8888
# then: ssh -L 8888:localhost:8888 user@server (tunnel)
Best Practices¶
- Use the command palette (
Ctrl+Shift+P) as your main way to learn the UI. - Organize the left sidebar: file browser, running kernels, git.
- Trust but verify kernels — a notebook runs whatever kernel you chose in the top-right.
- Restart & Run All before sharing any notebook.
- Save early, save often; JupyterLab autosaves by default (check Settings).
- Enable autosave + git pane so notebook edits are never lost.
- Use extensions sparingly — each adds startup weight and update friction.
Common Mistakes¶
| Mistake | Consequence | Fix |
|---|---|---|
| Running the wrong kernel (again) | Wrong env imports | Check top-right kernel name |
| Too many open kernels | RAM exhaustion | Shut down unused kernels (Running pane) |
Editing .py without reload |
Stale behavior in notebook | %autoreload 2 or restart kernel |
| Dragging cells across notebooks | Shared state confusion | Copy/paste deliberately |
| Ignoring the file browser for data | Can't find CSVs | Pin the data folder; use search |
| Installing extensions in wrong env | Extensions don't load | Install where JupyterLab is installed |
Troubleshooting¶
| Symptom | Cause | Fix |
|---|---|---|
jupyter lab opens old notebook UI |
Wrong command/alias | Use jupyter lab not jupyter notebook |
| Extension missing from UI | Not installed/restart needed | pip install; rebuild/restart lab |
| Port 8888 busy | Another server | jupyter lab --port 8890 |
| Kernel dies on huge DataFrame | Memory | Free memory, close other kernels, chunk reads |
| Git pane absent | Extension not installed | pip install jupyterlab-git; refresh |
Related Cheat Sheets¶
- Jupyter — magics, widgets, notebook habits (all apply here)
- VS Code — alternative host for the same notebooks
- Google Colab — hosted notebooks when you lack a GPU/box
- matplotlib.md · plotly.md — interactive output
- Home · Central Navigation Index
Official Documentation¶
Last Updated¶
2026-09-06 — Initial version.