SyntaxError when using cx_freeze on PyQt app

Viewed 1757

This is quite annoying problem that occurs when trying to build .exe file from Python 3 script using PyQt4. I think it is connected with using uic module for dynamic loading of .ui files. cx_freeze returns:

  File "E:\Python32_32\lib\site-packages\cx_Freeze\finder.py", line 366, in _LoadModule
    module.code = compile(codeString, path, "exec")
  File "E:\Python32_32\lib\site-packages\PyQt4\uic\port_v2\load_plugin.py", line 41
    except Exception, e:
                    ^
SyntaxError: invalid syntax

I have solved this problem some time ago but I have recently encountered it again. Finding solution on the web isn't easy so I decided to post Q&A on SO. Hope it will be helpful not only for me :-).

1 Answers
Related