Skip to content

One Line Command to Launch a Notebook with Pytorch

uv is changing how accessible Python is for new users.

If you want to try out PyTorch in a Jupyter Notebook, you can install uv and then run this single line command:

uv run --no-project --python 3.12 --with torch --with jupyter jupyter lab

uv downloads Python 3.12 if needed, installs PyTorch and Jupyter in a cached environment, and launches JupyterLab. --no-project keeps the command independent of a project in the current directory.

This command uses the platform’s default PyTorch wheel and does not detect or verify a GPU. For a specific CUDA, ROCm, or CPU-only build, follow How to Install PyTorch with uv and launch Jupyter from that configured environment.

Learn More

Last updated on