pip
is old school! uv
is faster and more convenient.
Here’s a quick-start guide:
uv
:pip install uv
(not recommended)uv init
to initiate the project folderuv add package1 package2 ...
to install packages and automatically update the requirementsuv run filename.py
Or, if you have code with a pyproject.toml
that you want to set up and run,
uv sync
That’s it! No more messing around with venv
and requirement.txt
s, and wrangling dependencies, and waiting for ten minutes for everything to install. It’s fast enough that you can spin up an entire version of Python for a single script.
Note the following:
uv
automatically creates and maintains a pyproject.toml
, which is a modern version of requirements.txt
that includes versioning, Python version, and more information for greater reproducibilityuv
also automatically creates a virtual environment and activates it for useuv
creates a lockfile
that ensures cross-platform reproducibility!This way, you never need to use pip
or virtualenv
or other tools: everything is handled consistently with uv
.
You can also use a specific version of Python for each project!