How do I compile a PyQt script (.py) to a single standalone executable file for windows (.exe) and/or linux? How do I compile a PyQt script (.py) to a single standalone executable file for windows (.exe) and/or linux? python python

How do I compile a PyQt script (.py) to a single standalone executable file for windows (.exe) and/or linux?


if you want completelly create one stand alone executable, you can try this : http://www.pyinstaller.org/ . i feel it's better to create one stand alone executable than cx_freeze or py2exe (in my experience). and easy to use (full documentation available in the site).

Update:As latest information from @SoursopTree and @LectureMaker, it now support python version 3.3 - 3.6.

Update: pass --onefile argument if you want to create completely standalone .exe. in example :

pyinstaller.exe --onefile --windowed app.py


After spending many weeks on this and trying all the alternatives - PyInstaller, py2exe, cx_freeze,... - I created my own library: https://build-system.fman.io/. It is based on PyInstaller but solves many of its common pain points. It also lets you create native installers on Windows, Mac and Linux.


You may want to check out cx_freeze. It claims to create executables which are "cross platform and should work on any platform that Python itself works on."

I came across it in exploring the moneyGuru package which uses PyQt. I downloaded the moneyguru.exe file to my Windows XP system, executed it, and it worked fine on Python 3.2.

You can clone the hg repo from here to see how it.s done.