Hi,
        
I am trying to package a PyQt program for OSX using PyInstaller 2, where PyQt4
(4.10) has been built against Qt 5.0.2 (from Git). The following simple example
works when run from PyDev but the packaged app doesn't work. When it is run
using "open /path/to/hello.app" the dialog doesn't appear and the process
appears to be hung. Also if I run it directly using
"/path/to/hello.app/Contents/MacOS/hello then I see the text "Hello" printed in
the terminal and then it hangs.

Is there something that I have missed? How do I debug this?

Glenn

import sys
from PyQt4.QtGui import QApplication, QMessageBox

def main():
    print "Hello"
    a = QApplication(sys.argv)
    m = QMessageBox(QMessageBox.Information, "Title", "Hello")
    m.exec_()

if __name__=="__main__":
    main()

Spec file generated using pyinstaller-2.0/utils/MakeSpec.py and modified to add
the BUNDLE class and to add libqcocoa.dylib.

a = Analysis(['hello.py'],
         pathex=['/Users/glenn/rp/src/demo'],
         hiddenimports=[],
         hookspath=None)

pyz = PYZ(a.pure)

exe = EXE(pyz,
      a.scripts,
      exclude_binaries=1,
      name=os.path.join('build/pyi.darwin/hello', 'hello'),
      debug=True,
      strip=None,
      upx=True,
      console=True )

# Had to add this so it would start without crashing
extralibs = [("qt4_plugins/platforms/libqcocoa.dylib",
"/path/to/libqcocoa.dylib", "BINARY")

coll = COLLECT(exe,
           a.binaries,
           a.zipfiles,
           a.datas,
           extralibs, # added this
           strip=None,
           upx=True,
           name=os.path.join('dist', 'hello'))

app = BUNDLE(coll,
        name=os.path.join('dist', 'hello.app'),
        appname="Hello",
        version = '0.1'
        )

Packaging command

python /path/to/pyinstaller.py -w -d -y --log-level=DEBUG hello.spec

--
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to