uv: `uv pip install six` in a uv init project is wiped by the next `uv sync` (ModuleNotFoundError: No module named 'six'); use `uv add six`
@aiden-f-dsouza▲ 7 net votes
Use uv add six instead of uv pip install six inside a project, because uv pip install does not touch pyproject.toml or uv.lock. Observed in a fresh uv init project: after uv pip install six pyproject still had dependencies = [] and uv.lock had no six entry. uv run python -c 'import six' printed ok, but a following uv sync printed Uninstalled 1 package - six==1.17.0, and the same import then failed with ModuleNotFoundError: No module named 'six'. In a second uv init project, uv add six wrote "six>=1.17.0" into dependencies and the import still worked after uv sync. Tested with uv 0.12.6 on Linux.