[Pythonmac-SIG] Py2App and PyQt4 Issues

J Silverman g1powermac at yahoo.com
Sat Apr 27 21:06:44 CEST 2013


Hi All,

I'm attempting to get py2app and PyQt4 to work on my Mac running OSX 10.6.  I've tried multiple variations of Python (2.7.4, 3.2.4, 3.3.1, etc), and also tried both the premade binary of PyQtx and compiled my own of the most recent stable version of PyQt4 (4.10.1).  Yet despite this, I get extremely similar results if I try building and running one of the example PyQt4 scripts included with Py2App.  On using Py2App with some of the variations above I'll get a bunch of these error messages during the build:

/usr/bin/strip: object: /Users/g1powermac/Desktop/py2app-0.7.3/examples/PyQt/hello_app/dist/hello.app/Contents/Resources/lib/python2.7/lib-dynload/PyQt4/QtCore.so malformed object (unknown load command 7)

There is only one variation where I don't get that message and that is if I use my own compiled version of PyQt4 and Python 3.3.1.  However, if I double click on the subsequent app, I get a screen that says "hello Error" with either an option to open the Console or Terminate.  Upon opening the Console, I see these error messages:

4/27/13 2:11:05 PM	[0x0-0x25025].org.pythonmac.unspecified.hello[9513]	Traceback (most recent call last):
4/27/13 2:11:05 PM	[0x0-0x25025].org.pythonmac.unspecified.hello[9513]	  File "/Users/g1powermac/Desktop/py2app-0.7.3/examples/PyQt/hello_app/dist/hello.app/Contents/Resources/__boot__.py", line 43, in <module>
4/27/13 2:11:05 PM	[0x0-0x25025].org.pythonmac.unspecified.hello[9513]	    _run()
4/27/13 2:11:05 PM	[0x0-0x25025].org.pythonmac.unspecified.hello[9513]	  File "/Users/g1powermac/Desktop/py2app-0.7.3/examples/PyQt/hello_app/dist/hello.app/Contents/Resources/__boot__.py", line 38, in _run
4/27/13 2:11:05 PM	[0x0-0x25025].org.pythonmac.unspecified.hello[9513]	    exec(compile(source, path, 'exec'), globals(), globals())
4/27/13 2:11:05 PM	[0x0-0x25025].org.pythonmac.unspecified.hello[9513]	  File "/Users/g1powermac/Desktop/py2app-0.7.3/examples/PyQt/hello_app/dist/hello.app/Contents/Resources/hello.py", line 5, in <module>
4/27/13 2:11:05 PM	[0x0-0x25025].org.pythonmac.unspecified.hello[9513]	    a = Qt.QApplication(sys.argv)
4/27/13 2:11:05 PM	[0x0-0x25025].org.pythonmac.unspecified.hello[9513]	AttributeError: 'module' object has no attribute 'QApplication'
4/27/13 2:11:05 PM	hello[9513]	hello Error
4/27/13 2:11:07 PM	com.apple.launchd.peruser.501[252]	([0x0-0x25025].org.pythonmac.unspecified.hello[9513]) Exited with exit code: 255

By the way, this is using Qt 4.8.4 and I could run the hello.py directly with python so it seems PyQt4 is installed correctly.  Does anyone know how to get this working?

Thanks,
J Silverman


More information about the Pythonmac-SIG mailing list