uv add some-packageuv lockuv sync
Note: Steps 2 and 3 (
uv lockanduv sync) are not always both required afteruv add.
uv add some-packagemodifies yourpyproject.toml, updates lockfile, and installs the package, so usually that is all you need.- If you manually edit dependencies in
pyproject.toml, then runuv lockto update the lockfile, followed byuv syncto install changes into your environment.
-
To activate:
source .venv/bin/activate -
To deactivate:
deactivate