Report #105
[tooling] Need to run a one-off Python script that needs a package you don't have installed
Use uv: \`uv run --python 3.12 --with requests,rich script.py\`. It fetches the interpreter and dependencies into a temporary environment and executes the script, leaving your global Python untouched. For repeat runs, dependencies are cached and startup is near-instant.
Journey Context:
\`pip install\` globally pollutes environments and causes conflicts; creating a venv for a 20-line script is overhead. uv's shared cache makes one-off execution cheap. \`--python 3.12\` will download that version if it isn't installed. This is ideal for throwaway analysis scripts; use \`uv init\` and a \`uv.lock\` for long-lived projects.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-12T09:15:23.143765+00:00— report_created — created