[Pythonmac-SIG] Py2app: import errors while running theinstalledapp (PyQt4.Qt imports)

Ronald Oussoren ronaldoussoren at mac.com
Mon Mar 12 15:50:37 CET 2007


 
On Monday, March 12, 2007, at 03:30PM, "Ninad Sathaye" <ninad at nanorex.com> wrote:
> 
>Hi all, 
>
>Does anyone know how to resolve this issue? (or if this or similar topic has
>been discussed previously, can someone point me to that thread?)

Could you try using the following command to build the app bundle:

    python setup.py py2app --packages=PyQt

AFAIK Py2app used to contain some special code for PyQt but that got ripped out because it no longer worked with recent versions of PyQt and nobody bothered to send an updated recipe.

Ronald

>
>Thanks,
>
>Ninad
>
>> -----Original Message-----
>> From: Ninad Sathaye [mailto:ninad at nanorex.com] 
>> Sent: Thursday, March 01, 2007 10:22 AM
>> To: pythonmac-sig at python.org
>> Subject: [Pythonmac-SIG] Py2app: import errors while running 
>> the installedapp (PyQt4.Qt imports)
>> 
>> Hi, 
>> 
>> I have built a package using py2app on MACOSX 10.3.9.  My 
>> application uses Qt4.2
>> (PyQt4.1.x) framework.  When run the application (installed 
>> using the created
>> package) it gives import errors.
>> 
>> Example: 
>> "
>> from PyQt4.Qt import QApplication
>> ImportError : Cannot import name QApplication. 
>> "
>> 
>> Py2app seems to break my PyQt4 directory into  two parts and 
>> put them in different places : 
>> (A) the Qt.pyc into 
>> "/Contents/Resources/lib/python2.3/site-packages.zip/PyQt4"
>> 
>> (B) and the .so files [Example: QtGui.so] into 
>> "/Contents/Resources/lib/python2.3/lib-dynload/PyQt4" 
>> 
>> Am I leaving out a necessary option?  [ I tried manually 
>> copying .so files from
>> (B) to (A) ..that resolved the import problems but then my 
>> app crashed.] 
>> 
>> ++++
>> Note: During the pkg building process, I got an error which 
>> seems identical to the one in this message --
>> 
>> "http://mail.python.org/pipermail/pythonmac-sig/2007-February/
>> 018659.html"   --
>> 
>> " malformed object (unknown flavor for flavor number 0 in 
>> LC_UNIXTHREAD command 10 can't byte swap it) "
>> 
>> But the package still got built.  Could this be the 
>> underlying problem? 
>> 
>> +++
>> Specs --
>> *System: PowerPC G4, OSX 10.3.9. 
>> *Python version: Python2.3
>> *Py2app details:  py2app-0.3.5, macholib-1.1, 
>> modulegraph-0.7, setuptools-0.6c3
>> ++++
>> 
>> Any help would be greatly appreciated. 
>> 
>> Best Regards, 
>> 
>> Ninad 
>> 
>> 
>> 
>> 
>
>
>_______________________________________________
>Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
>http://mail.python.org/mailman/listinfo/pythonmac-sig
>
>


More information about the Pythonmac-SIG mailing list