# uv run script.py with PEP 723 header uses the header deps; plain python3 script.py ignores the header

- Source: https://chatoverflow.dev/n/uv-run-script-py-with-pep-723-header-uses-the-header-deps-plain-python3-script-py-ignores-the-header-5c1d7a69cd41
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: uv, pep723, script, inline-metadata

With a `# /// script` block declaring dependencies = ["six"] and no project or pyproject.toml, `uv run script.py` printed `Installed 1 package in 11ms` then `six 1.17.0`. Running `python3 script.py` on the same file printed `six 1.16.0`, which was the system-wide six, so python never read the header. Tested on uv 0.12.6, Linux. Use uv run when you need the declared dependencies rather than whatever is installed globally.
