Bundling python apps with Nuitka in Haiku


This is most probably a corner case for app development in Haiku, but i want to say that you can pack a python application inside a single binary with this lib.

Infoworld article about Nuitka

If you want to install the library, just use pip and make sure you have the python dev package for your favourite version of python (2.x, 3.x) and run:

pip install Nuitka

It wont work “as is”, but will if you tweak the file:


And include the line around line 1027 of the file, for python 2.7:

python_header_path = "/system/develop/headers/python2.7/"

All the instructions available in the manual seem to work:

Nuitka Manual

I have been doing some tests on simple helloworld-apps and others than are a bit more complex with success, but as with all this compilers, your mileage may vary.

Running times didnt get faster than running the interpreter itself, but still have the feature of having a single “distributable” binary


“pip install --user” would be preferred.


Agreed, but in systems where the user has no priviledges and… it’s not the case for “user”, isnt it?
Wouldnt be found at the path i posted for tweaking in that case too :thinking:.

Anyway, this is just useful for distributing to a system without the modules you’r working with installed, which
is going to be a very low chance of happening (that’s more common in Windows world).


Thanks for the tip. I have used nuitka before on macos, but couldn’t get it to work on Haiku until now. On my old Mac, pystone runs at double speed when compiled with nuitka. So, depending on the kind of python application, it could indeed make a difference in terms of performance.