Not published yet

The Python Script That Installs Itself

Your friend runs it and gets a red ‘ModuleNotFoundError’. A four-line comment at the top of the file, plus ‘uv run’, makes one .py carry its own dependencies and just work on their machine.

Publishing tomorrow morning · November 25, 2026
The Python Script That Installs Itself

You sent a friend a handy Python script and they got a red ‘ModuleNotFoundError’ — so you sent them half of something. This builds a link-checker they can actually run: a PEP 723 comment block at the top of the file lists its dependencies, and ‘uv run’ fetches them (and even Python itself, on a machine that has none) into a throwaway environment on the first run. One file, one command — no virtualenv, no ‘pip install’ chore — plus the two traps (listing a standard-library module, and the surprising way the note behaves inside a project folder) that would otherwise cost you an evening. Run on uv 0.11.32.

The Python Script That Installs Itself | Vibecodes