Skip to content

One Line Command to Launch a Notebook with Pytorch

January 15, 2025·Tim Hopper

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 --python 3.12 --with "torch~=2.4" --with jupyter --with "numpy<2" jupyter lab

uv will grab all your dependencies (including Python 3.12, if you don’t have it installed), install them in an isolated environment, and launch Jupyter Lab.

Last updated on