Pyinstaller is bad choice for compile python scripts :(

hi guys

Pyinstaller compile python script as bytecode and it’s:

  • slow running
  • easy for decompile
  • for beginner user is good

but best compiler for python scripts nuitka .

Hey @Javad welcome to the forum

Pyinstaller is bad choice for compile python scripts :frowning:

I’m not sure I quite agree with that :wink:

While compiled code is of course faster, when building GUI applications with Qt most of the hard work is in done in Qt itself – your application only drops back into Python for your custom methods. That makes the quoted speedup unattainable for any PyQt5 projects. The ones which would benefit the most from speed up (data processing/analysis) are likely using numpy, etc. where (again) the heavy lifting is done entirely in compiled C/Fortran code. Slowdown is usually down to inefficient code.

The thing that would interest more more though is the usability side of it – PyInstaller can be fiddly to get working. Is nuitka more reliable? It requires a C++ build environment, which has always caused trouble on Windows (in Python too before wheel packages) – how easy is it to set that up?

If you’d like to write a tutorial for using nuitka for packaging PyQt5 apps I think it would be a great addition to the site.