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 labuv 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.
Learn More
- How to install PyTorch with uv for production setups with GPU support detection and version management
- Set up a GPU data science project with pixi for a conda-forge approach to managing CUDA and scientific libraries
- uv: A Complete Guide for the full range of uv workflows and features
Last updated on