Packaging Python: PyInstaller, Nuitka, Cython

preview_player
Показать описание
#python #dependencies #standalone #pyinstaller #nuitka #cython
Sometimes you may want to make a standalone distribution of your code. Let's find out how to do it and what way is the best for you.
Рекомендации по теме
Комментарии
Автор

Hello. I have a project with external dependancies. How can I compile it to .exe using Cython ?

bill
Автор

And as I saw Nuitka's executables are not fully Native code there are still some python files packed inside an executable. Does it somehow make it easier to reverser to ger sources ?

bill
Автор

How to build standalone executable on Windows using Cython ? Share some guide pls

bill
Автор

I wouldnt advice Nuitka know. Because it gives a lot of false(?) positives after VirusTotal Checking. I made simple program and it brought to 36/72 positives which is kinda huge. Also it seems that nuitka uses Visual Studio compiler by default which leads to a lot of IP connections which due to my research think it is Microsoft telemetry checking for firstly created executables which makes me unhappy.

For me now Pyarmor is the best approach it is still hard to reverse but it gives really a few false positives, 1-5 usually

bill
Автор

Would Free version of Nuitka be enough to protect source code ? Or at least make it extremely hard for experienced reverser to obtain the code ?

bill
Автор

Can you please help me ?
My python project is bit heavy.
Eg:
MyMainApp.py > Cython Executable MyMainApp
MyModule1.py > Cython Shared Object MyModule1.so
MyModule2.py > Cython Shared Object MyModule2.so
MyModule3.py > Cython Shared Object MyModule3.so

Now how to make these 4 files as a single executable ?

Note: MyMainApp.py is not shared object and it is executable file.


If I place all my MyModuleX.py code inside MyMainApp.py
I get below errors.
virtual memory exhausted: Cannot allocate memory
or
# cc1: out of memory allocating 28477176 bytes after a total of 387055616 bytes

Seems GCC needs > 4GB RAM which is not possible from 32bit OS

How can I proceed ?
Is there any tool to bundle these files and give me a single executable binary file ?

My System:
Raspberry Pi - 4
Linux 32bit Buster.

Gaamaa-ozeflfn
Автор

I wish to distribute an API I built on python but don’t want the source code to be deconstructed easily. Would Nuitka compilation be a good way to achieve this.

The API will be deployed on the clients server and hence the ask

saisuresh
Автор

Can Cython work with all python modules or libraries or not with all?
I've also read one comment that writing a more or less large program in Cython is difficult because of the huge number of type declarations and because it is difficult to catch errors - is this true?

Fillmoreb