Why does it matter if a program is a self-contained binary? It seems like such an odd requirement. If you really want that it seems in principle easy to compile it all into one script with no imports and put a shebang at the top. What's the point, though?
Pyinstaller is pretty good for if you need a standalone installer.
> Why does it matter if a program is a self-contained binary?
Because simple is better than complex. I'd rather download a binary than download a binary + dependencies + set them up + bookkeep for when I want to delete all those files.
> Pyinstaller is pretty good for if you need a standalone installer.
PyInstaller doesn't work for many edge cases. If you're using a Python package that uses a compiled binary written in another language, good luck on your way down the rabbit hole of PyInstaller config. I personally could not succeed in packaging a uvicorn app, for example.
> Why does it matter if a program is a self-contained binary? It seems like such an odd requirement.
Because sometimes I just want to write `my_program | your_program` without learning how to install and set up a program in a language I don't personally use, particularly when that language has the worst packaging ecosystem of any mainstream language.
However, to address the other part of your comment, pipx works quite well for installing command line applications.