When given a Python project codebase, this skill helps the agent to set up virtual environments, install dependencies, and run scripts.
Assume uv is already available on PATH.
pyproject.toml exists: use project workflow (uv sync, uv run)requirements.txt exists: use pip workflow (uv venv, uv pip install -r ..., .venv/bin/python ...)From the repo root (where pyproject.toml is):
uv syncNotes:
.venv and installs deps there.Always run within the project environment:
uv run -- python <script.py> [args...]uv run -- python -m <module> [args...]Notes:
uv run executes inside the project environment and ensures it is up-to-date.From the repo root:
uv venv # creates .venv by defaultuv pip install -r requirements.txtRun using the venv interpreter directly (no activation required):
.venv/bin/python <script.py> [args...].venv/bin/python -m <module> [args...](uv will also automatically find and use the default .venv in subsequent invocations when you use uv pip ... commands.)
test -x .venv/bin/pythonuv pip list (verify packages installed)