<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; "><div style="font-family: Calibri, sans-serif; ">Hi All,</div><div style="font-family: Calibri, sans-serif; "><br></div><div style="font-family: Calibri, sans-serif; ">I'm just wondering if anybody out there has had any success with freezing a PyQt5 app into an executable with cx_Freeze yet? I can successfully create a distribution with an executable in it, but when this is run the application crashes with the classic 'widget_test.exe has stopped working dialog' from Windows. This seems to occur at the point of instantiating a QApplication object, if I use QCoreApplication everything works fine. The PyQt app couldn't be simpler and looks as follows:</div><div style="font-family: Calibri, sans-serif; "><br></div><div style="font-family: Calibri, sans-serif; "><div><font face="Courier">import PyQt5</font></div><div><font face="Courier">from PyQt5.QtCore import *</font></div><div><font face="Courier">from PyQt5.QtGui import *</font></div><div><font face="Courier">from PyQt5.QtWidgets import *</font></div><div><font face="Courier"><br></font></div><div><font face="Courier">If _<span style="font-style: italic; ">name</span>_=="_<span style="font-style: italic; ">main</span>_":</font></div><div><font face="Courier"> from sys import argv</font></div><div><font face="Courier"> a=QApplication(argv)</font></div></div><div style="font-family: Calibri, sans-serif; "><br></div><div>And the cx_Freeze setup.py script is as follows:</div><div><font face="Courier"><br></font></div><div><div style="font-family: Calibri, sans-serif; "><font face="Courier">import sys </font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier">from cx_Freeze import setup, Executable</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"><br></font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier">base = None </font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier">if sys.platform=='win32': base='Win32GUI'</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"><br></font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier">options={</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"> 'build_exe': {</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"> 'includes': 'atexit'</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier">}</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"><br></font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier">executables=[</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"> Executable(</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"> script='widget_test.py',</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"> base=base</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier">]</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"><br></font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier">setup(</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"> name='widget_test',</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"> version='0.1',</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"> description='Widget Test',</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"> options=options,</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"> executables=executables</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier">)</font></div></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"><br></font></div><div><font>My configuration is as follows:</font></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"><br></font></div><div style="font-family: Calibri, sans-serif; "><div>Python 3.3.5</div><div>PyQt5 5.2.1 based on Qt5.2.0 32bit (installed from pre-built MSI)</div><div>cx_Freeze 4.3.2</div></div><div style="font-family: Calibri, sans-serif; "><font face="Courier"><br></font></div><div><font>I've profiled the generated executable (as created by running python setup.py build) using dependency walker and the issue appears to occur in KERNELBASE.DLL (I can provide the profile output if it would be of any use).</font></div><div><font><br></font></div><div><font>I would appreciate any help with getting this working or suggestions of alternative ways to package my application (I'm currently using Py2exe/app but these don't yet support Python3).</font></div><div><font><br></font></div><div><font>Thanks very much, Rob</font></div></body></html>