Python Developer Tooling Handbook logo

Python Developer Tooling Handbook

Subscribe
Archives
January 15, 2025

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 --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.

Don't miss what's next. Subscribe to Python Developer Tooling Handbook:
Github
This email brought to you by Buttondown, the easiest way to start and grow your newsletter.