[PyQt] pyqtdeployed app crashes on launch

Phil Thompson phil at riverbankcomputing.com
Mon Jul 14 09:17:36 BST 2014

On 14/07/2014 12:43 am, Dave Gradwell wrote:
> Hi Lloyd, thanks for the message.
> I am still just using the example in
> /examples/mainwindows/application/application.py
> and the line of code reads
> import application_rc
> ... and application_rc.py exists as a sibling of application.py.
> For what it's worth, the application runs as expected when interpreted
> with python3.4 from the command line (so the code intrinsically
> works).
> I regenerated the file using pyrcc5 (just to be sure) - but to no 
> avail.
> (Yep, the file has content - and it works when application.py is run
> from a normal Python interpreter).
>> You're building verbose?  Did you look at the makefile
>> and the log of
>> the compile?  Does the frozen file exist in the tmp
>> directory?
> I wasn't, but I am now.  The output in pyqtdeploy's 'build' tab is:
> ......
> Freezing /Users/admin/Desktop/app-4/application_rc.py
> Running '/Users/admin/Desktop/building/built/bin/python3.4m
> /var/folders/wq/k3bzbz7d4m15ddsw3psx003c0000gn/T/freeze.py --as-data
> /Users/admin/Desktop/app-4/build/resources/app-4/application_rc.pyf
> /Users/admin/Desktop/app-4/application_rc.py'
> ........
> There is a section in the Makefile that an expert might understand.
> It is the only mention of application_rc.
> ........
> compiler_rcc_make_all: qrc_pyqtdeploy.cpp qrc_stdlib.cpp 
> qrc_site-packages.cpp
> compiler_rcc_clean:
>     -$(DEL_FILE) qrc_pyqtdeploy.cpp qrc_stdlib.cpp 
> qrc_site-packages.cpp
> qrc_pyqtdeploy.cpp: resources/pyqtdeploy.qrc \
>         resources/app-4/application_rc.pyf
>     /Users/admin/Qt5.3.1/5.3/clang_64/bin/rcc -name pyqtdeploy
> resources/pyqtdeploy.qrc -o qrc_pyqtdeploy.cpp
> qrc_stdlib.cpp: resources/stdlib.qrc \
> .......

So you are attempting to nest resource files? Even if this worked I'm 
not sure it's a good idea.

It looks like pyqtdeploy needs to detect when a .qrc file is specified 
as part of the application and to add it to the .pro file. You can try 
this manually. You would also need to remove the import of the pyrcc5 
generated module (or make it conditional).


More information about the PyQt mailing list