alpha

Jupyter

Quick reference for JupyterLab commands and patterns

#python#jupyter#notebooks

Installing and Running JupyterLab

uv pip install jupyterlab

See the uv manual for installation and environment setup.

# Start JupyterLab (opens browser automatically)
uv run jupyter lab

# Open specific notebook
uv run jupyter lab path/to/notebook.ipynb

Most of the time you will need additional packages for data science and visualization:

# data science
uv pip install pandas numpy matplotlib seaborn scikit-learn

# databases
uv pip install sqlalchemy psycopg2-binary opensearch-py

# helpers
uv pip install joblib

Executing Jupyter Notebooks from Command Line

Run notebooks headlessly to iterate on code and inspect outputs:

# Execute and save notebook with outputs
uv run jupyter nbconvert --execute --to notebook notebook.ipynb

# Execute in-place (overwrites original)
uv run jupyter nbconvert --execute --inplace notebook.ipynb

Converting Jupyter Notebooks to Python Scripts and HTML

# To Python script
uv run jupyter nbconvert --to script notebook.ipynb

# To HTML (static report)
uv run jupyter nbconvert --to html notebook.ipynb

Managing Jupyter Kernels for Multiple Python Environments

# List available kernels
uv run jupyter kernelspec list

# Remove kernel
uv run jupyter kernelspec remove myenv

References