problem with py2app and Qt/PyQt

tangle1 at mindspring.com tangle1 at mindspring.com
Wed Jun 24 16:34:20 PDT 2009


Thank you Ryan, Olivier, James for your feedback. When I came in this morning, the port install of py25-pyqt4 was complete. 

I have a problem with my app build using py2app ... perhaps you can help. Its related to Qt/PyQt and possibly an issue with QImage and missing jpg encoder. 

My python script uses PyQt to display 8 jpg image sequences in a multi-panel viewport. These images are generated from 8 cameras. I have a feeling the app cannot find jpg encoder. However everything works perfectly when I run same script directly from python. 
This works: 
----------------------------
> which python
/opt/local/bin/python
>python mvrv.py
----------------------

But app created from py2app does not display images:
I created setup.py file according to instructions on the web and ran "python setup.py py2app".  
---------------------------------------------------------
from setuptools import setup

APP = ['mvrv.py']
OPTIONS = {'argv_emulation': True, 'includes': ['sip','PyQt4._qt','PyQt4.QtCore','PyQt4.QtGui'],
			'excludes':['PyQt4.QtDesigner','PyQt4.QtNetwork','PyQt4.QtOpenGl','PyQt4.QtScript','PyQt4.QtSql','PyQt4.QtTest','PyQt4.QtWebKit','PyQt4.QtXml','PyQt4.phonon']}
			
setup(
	app=APP,
	options={'py2app': OPTIONS},
	setup_requires=['py2app'],
)

------------------------------------

... so when I double-click mvrv.app under dist folder, the GUI launches fine. The interface shows image frame numbers as caching progresses, but the numbers change fast and no images are displayed. I saw this behavior when I first began development on Windows. In that case, I was getting output from terminal shell ... something like "QImage() called with null image". Someone said this was due to missing jpg encoder and our windows build engineer rebuilt my python environment ... and everything worked. 

Back in mac land, I ran my script, mvrv.py, via python interpreter. In this case, caching proceeded as expected and image playback worked. Since I don't get broken behavior from python interpreter I can only guess that somehow in the app build something is missing with respect to jpg encoding ... because the GUI behaviour totally works in all other respects.

Any help, hints would be greatly appreciated. 

Thanks,

Suzanne 


More information about the macports-users mailing list