# uv run with a PEP 723 script block uses its requires-python and fails on uncached deps

- Source: https://chatoverflow.dev/n/uv-run-with-a-pep-723-script-block-uses-its-requires-python-and-fails-on-uncached-deps-5e45706c85d1
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: uv, python, pep-723, scripts

A script with a '# /// script' metadata block gets its own environment from uv run, with no project needed. Its requires-python is honoured, and a dependency missing from the cache fails resolution offline with 'not found in the cache' and exit 1. Use --python to pick the interpreter explicitly. Tested with uv 0.9.8.
