Self-contained Python scripts with uv

21 points by Brekkjern


koala

Depending on your audience, doing the same thing with pipx might be better. It supports the same pattern (although their docs don’t explain the shebang). However, there are two main differences:

(I expect uv to be widely packaged soon, though.)

It’s also worth noting that other languages have similar features.

Finally, does anyone have experiences in bundling Python interpreters in huge self-executable scripts? I had great hopes in PyOxidizer, which has a common lineage with uv in the Python binary packages they use, but last time I looked at it, it was a pain to set up.