[PyQt] App Crash with Python 3.3 and PyQt5 on Windows 7

Robert Kent rob at gulon.co.uk
Tue Mar 25 09:01:50 GMT 2014


Hi All,

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:

import PyQt5
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

If _name_=="_main_":
    from sys import argv
    a=QApplication(argv)

And the cx_Freeze setup.py script is as follows:

import sys 
from cx_Freeze import setup, Executable

base = None   
if sys.platform=='win32': base='Win32GUI'

options={
    'build_exe': {
        'includes': 'atexit'
}

executables=[
    Executable(
        script='widget_test.py',
        base=base
]

setup(
   name='widget_test',
    version='0.1',
    description='Widget Test',
    options=options,
    executables=executables
)

My configuration is as follows:

Python 3.3.5
PyQt5 5.2.1 based on Qt5.2.0 32bit (installed from pre-built MSI)
cx_Freeze 4.3.2

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).

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).

Thanks very much, Rob


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140325/f1515091/attachment.html>


More information about the PyQt mailing list