top | item 40040028

(no title)

JamesCoyne | 1 year ago

This is a good place to mention https://nuitka.net/ which aims to compile python programs into standalone binaries.

discuss

order

dboreham|1 year ago

Not binaries, but I've had success with Shiv[1] which builds a Python application into a single-file package that can be run on any machine provided it has the Python binary installed (but not much else). We use it to ship products that run as-is on both Linux (including WSL2) and macos.

[1] https://shiv.readthedocs.io/en/latest/

tripflag|1 year ago

I built a Win10 binary with Nuitka just the other day, and was surprised to find the pyinstaller binary had higher performance at runtime. Pyinstaller also had several other advantages, such as producing smaller binaries, and building faster, and Win7 support.

For reference, I kept notes on the exact commands I used: https://github.com/9001/copyparty/blob/hovudstraum/docs/nuit...

ijustlovemath|1 year ago

I've had better luck with pyinstaller! Nuitka is buggy when you use multiprocessing

cmehdy|1 year ago

Same here.

Wrote a simple program to which I added Fire to parse arguments as a CLI, and Gooey/Tkinter for a GUI on top of it. To get a working standalone .exe file which does not require folders on the side, Pyinstaller did the job. Unfortunately it also triggers antivirus scans for some AVs..

ahgamut|1 year ago

I've tried nuitka before, and a recent question that occurred to me was: does nuitka have an option to output just C files? Something like:

  python -m nuitka example.py --no-compile
Might be interesting to see if the above is possible. We could get things like a completely-statically-compiled Python stdlib within the APE.