<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=950342018-19112004><FONT face=Arial 
color=#0000ff size=2>Bob,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=950342018-19112004><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=950342018-19112004><FONT face=Arial 
size=2><FONT color=#0000ff>Thank you very much for the reply. As you suggested, 
I&nbsp;tried "--packages OpenGL", which will solve the OpenGL&nbsp;version 
problem, but I still got the error: "<FONT face="Times New Roman" 
size=3>QPaintDevice: Must construct a Qapplication before a QPaintDevice." 
</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=950342018-19112004><FONT 
color=#0000ff></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=950342018-19112004><FONT color=#0000ff>I 
don't think it's&nbsp;any problem of my scripts, it works without any problem if 
I&nbsp;start it manually&nbsp;in a shell window, and the same program works on 
Linux and Windows too. I suspect the problem is&nbsp; the way how py2app deals 
with&nbsp;PyQt/Qt modules.&nbsp; I noticed&nbsp;in the result package, it 
includes&nbsp;qt.so, qtgl.so, sip.so in the&nbsp;lib-dynload directory, and 
qt.pyc,&nbsp;qtgl.pyc, sip.pyc in the site-packages.zip file, but no where I can 
find anything about&nbsp;libqt.3.dylib and libqui.1.dylib in the package, 
I&nbsp;guess they are Qt libraries, which are needed to run my 
program.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=950342018-19112004><FONT 
color=#0000ff></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=950342018-19112004><FONT color=#0000ff>In 
the package that I created on Windows using py2exe,&nbsp;&nbsp;similar files 
exist: *.pyc in a zip file, and&nbsp; corresponding *.dll files&nbsp;outside, 
but there is&nbsp;one more dll file&nbsp;called:&nbsp; qt-mt333.dll, the Qt 
library file on Windows.&nbsp; I&nbsp;tried to copy those *.dylib files into the 
lib-dyload directory,&nbsp;but no success.&nbsp; I wonder if you have any work 
around for this problem at present?&nbsp; Thanks a lot,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=950342018-19112004><FONT 
color=#0000ff></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=950342018-19112004><FONT 
color=#0000ff>Regards,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=950342018-19112004><FONT 
color=#0000ff></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=950342018-19112004><FONT 
color=#0000ff>Huaicai</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=950342018-19112004><FONT 
color=#0000ff>&nbsp;&nbsp;</FONT></SPAN></DIV>
<DIV dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Bob Ippolito [mailto:bob@redivi.com] 
<BR><B>Sent:</B> Friday, November 19, 2004 11:21 AM<BR><B>To:</B> Huaicai 
Mo<BR><B>Cc:</B> pythonmac-sig@python.org<BR><B>Subject:</B> Re: [Pythonmac-SIG] 
Py2app working with PyQt, PyOpenGL applications?<BR></FONT><BR></DIV>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV></DIV><FONT face=Arial color=#0000ff size=2></FONT><FONT face=Arial 
  color=#0000ff size=2></FONT><BR>On Nov 19, 2004, at 5:56 PM, Huaicai Mo 
  wrote:<BR><BR>
  <BLOCKQUOTE><?fontfamily><?param Arial><?smaller>I am trying to use py2app 
    to build an application bundle distribution on Mac OS X. I got some 
    problems, I wonder if any one has similar experiences or any ideas for 
these?<?/smaller><?/fontfamily><BR><BR><?fontfamily><?param Arial><?smaller>My 
    Mac OS X is 10.2.8. I built py2app from source, since the py2app-0.1.5 
    installation package needs 10.3 installer. My software uses PyQt, PyOpenGL 
    packages. Same as py2exe, py2app can't find the "sip" module, which is used 
    by PyQt,&nbsp; so I add the option: "--includes sip", this works fine, but 
    the problem is when I run the application, I got an error:<?/smaller><?/fontfamily><BR></BLOCKQUOTE><BR>The next version of py2app 
  will include workarounds for PyQt and PyOpenGL, assuming that an easy-ish to 
  install version of PyQt is available by the time I do it. I'll probably 
  release a new version of py2app in two or three weeks. Until then, PyQt is 
  completely untested and I can't really help you with anything PyQt 
  specific.<BR><BR>
  <BLOCKQUOTE><?fontfamily><?param Arial><?smaller>IOError: [Errno20] Not a 
    directory: 
'&#8230;./Contents/Resources/Python/site-packages.zip/OpenGL/version'.&nbsp;<?/smaller><?/fontfamily> 
    <BR><BR><?fontfamily><?param Arial><?smaller>I tried to add the file 
    'version' from OpenGL directory to site-packages.zip and extract the zip 
    file into a directory called site-packages.zip, the above error disappeared, 
    but I got an new error:<?/smaller><?/fontfamily><BR></BLOCKQUOTE><BR>Don't do 
  that.<BR><BR>
  <BLOCKQUOTE><?fontfamily><?param Arial><?smaller>QPaintDevice: Must 
    construct a Qapplication before a QPaintDevice.&nbsp; My application works 
    fine and doesn't have such errors if I just start it from a shell window 
    like: pythonw &#8230;./myapp.py.<?/smaller><?/fontfamily><BR></BLOCKQUOTE><BR>This 
  sounds like an error in your script or something, I can't help you with that. 
  Maybe using --packages for sip and PyQt (whatever the package names are 
  called) will fix this? I haven't looked at PyQt in quite some time and have no 
  idea what nasty hacks it uses.<BR><BR>
  <BLOCKQUOTE><?fontfamily><?param Arial><?smaller>I also tried&nbsp; 
    "--excludes OpenGL" module and then manually copy the OpenGL directory&nbsp; 
    from Python.frameworks to "site-pakcages.zip" and "lib-dynload" directories, 
    the trick that I used for py2exe on Windows, but it seems this is not<BR><?/smaller><?/fontfamily></BLOCKQUOTE><BR>Either hack the OpenGL 
  __init__ to use a sane method to acquire its version, or use --packages OpenGL 
  to include the package as-is (out of the zip)<BR><BR>
  <BLOCKQUOTE><?fontfamily><?param Arial><?smaller>working here: " Fatal 
    Python error: Interpreter not initialized (Version mismatch?) "<BR><?/smaller><?/fontfamily></BLOCKQUOTE><BR>This is because Python itself 
  is included in your application, but the OpenGL extension links directly to 
  your /LIbrary/Frameworks/Python.framework. It explodes because once you load 
  that extension, you have *TWO* Python libraries in your process. When using 
  py2app correctly (i.e. not hacking around the application bundles on your 
  own!) it will automatically take care of this for you by rewriting the Mach-O 
  load commands to point to your in-bundle 
Python.<BR><BR>-bob<BR></BLOCKQUOTE></BODY></HTML>