Docker
Astral-sh/uv
Standard Workflow
uv init # initialize the project
uv venv # create a virtual environment for the project
uv add torch [dependency] # add dependency (e.g., pandas, numpy, etc.)
uv sync # according to project.toml & uv.lockSpecifically, uv sync will do 3 things:
- Install missing packages
- Upgrade or downgrade existing packages to the versions specified in the lock file
- Remove unnecessary packages from the virtual environment that are not listed in the dependencies
- Install your own source code packages into the current .venv (in edit mode), such that it becomes a top-level package in your virtual environment - it can be imported using an absolute path to any directory, and CLI scripts run normally.