10 ms·
Expect it does require libpython and at least on Ubuntu 20.04 it links against the dev version of the library. So not only can you not run the resulting binary
by nextlevelwizard 5y ago
Expect it does require libpython and at least on Ubuntu 20.04 it links against the dev version of the library. So not only can you not run the resulting binary on any random Ubuntu 20.04 you also need to install same version of the python and the "-dev" version.
I did try this. With the "stock" python3 (3.8.something) I couldn't get nuitka to compile my code (or the example from the docs). With python3.9 I could start the compilation, but I didn't have libpython-dev shared object and finally with python3.9-dev I was able to make the binary. However after transfering it to another Ubuntu 20.04 machine I couldn't run it since it was linked against libpython3.9-dev.
Just as side note. The same python code (i.e. the .py file) would run on both machines out of the box.
- paiute 5y agoit has an option to build with libpython. so your comment is incorrect.
- nextlevelwizard 5y agoI guess there is a good reason for it to not be default behavior
- BiteCode_dev 5y agoIf you pass the proper option, it will compile everything, including libpython, resulting in a stand alone executable. The only dep would be libc, and if you compile against an old version, it should be forward compatible.