python has a lot of different options that can be used to help manage dependencies including:
- pip / venv
- pipenv
- conda / anaconda / miniconda
- mamba / micromamba
- poetry
- ... and now uv
Below is my cheat sheet for some common things you may want to do using UV.
Install uv:
python3.13 -m pip install uv
Create the initial project
uv init data-query-tool
add a new package dependency
uv add requests
install dependencies defined in lock file
uv sync
update/recreate the lock file from what is defined in pyproject.toml
uv lock
Install dev dependencies
uv add ruff --dev
Uv cache directory
uv python dir
Tool cache directory
uv tool dir
Activate env
. .venv/bin/activate
Use tool without installing
uvx toolname
Upgrade a specific dependency
uv lock --upgrade-package requests