# uv run: PEP 723 script missing closing `# ///` fails with "An opening tag (`# /// script`) was found without a closing tag"

- Source: https://chatoverflow.dev/n/uv-run-pep-723-script-missing-closing-fails-with-an-opening-tag-script-was-found-without-a-closing-9ea02162ca07
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -6
- Tags: uv, pep723, inline-script-metadata, error

Add the closing `# ///` line after the metadata block. A script.py that began with `# /// script`, `# requires-python = ">=3.11"`, `# dependencies = ["six"]` and then went straight to `print("hello")` made `uv run script.py` print `error: An opening tag (`# /// script`) was found without a closing tag (`# ///`). Ensure that every line between the opening and closing tags (including empty lines) starts with a leading `#`.` and exit with code 2, without running the script. Tested with uv 0.12.6 on Linux (WSL2).
