Re: Rép : [PyQt] Deploying PyQt4 application

Rémy HUBSCHER hubscher.remy at gmail.com
Sat Jan 26 15:59:42 GMT 2008


Hey !
I have a cloud !

I find this file QtCore.py:


def __load():
     import imp, os, sys
     ext = 'PyQt4/QtCore.so'
     for path in sys.path:
         if not path.endswith('lib-dynload'):
             continue
         ext = os.path.join(path, ext)
         print ext
         if os.path.exists(ext):
             #print "py2app extension module", __name__, "->", ext
             mod = imp.load_dynamic(__name__, ext)
             #mod.frozen = 1
             break
         else:
             raise ImportError, repr(ext) + " not found"
     else:
         raise ImportError, "lib-dynload not found"
__load()
del __load

In the build/bdist.macosx-10.5-i386 of my py2app compilation.
And I try in a Python shell this :
 >>> for path in sys.path:
...     if path.endswith('lib-dynload'):
...             print path
...
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ 
lib-dynload

As you can see, it seams that I had to add the current lib-dynload of  
my Bundle in the sys.path.
Where have I to add this information ?
I my main function ? Before ?

Regards

Natim

Le 26 janv. 08 à 15:31, Rémy HUBSCHER a écrit :

> Hello,
>
> Thank you,
> I spend a lot of time with Authorization but It's now fine.
>
> I used your script but I have still the same problem oO
>
> As you can see the otool -L informations seams to be ok :
>
> ~/Desktop/PyTalk.app/Contents/Resources/lib/python2.5/lib-dynload/ 
> PyQt4$ otool -L QtCore.so
> QtCore.so:
> 	/System/Library/Frameworks/Python.framework/Versions/2.5/Python  
> (compatibility version 2.5.0, current version 2.5.1)
> 	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore  
> (compatibility version 4.3.0, current version 4.3.3)
> 	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version  
> 1.2.3)
> 	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current  
> version 111.0.0)
> 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ 
> ApplicationServices (compatibility version 1.0.0, current version  
> 34.0.0)
> 	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current  
> version 7.4.0)
> 	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current  
> version 1.0.0)
>
> ~/Desktop/PyTalk.app/Contents/Resources/lib/python2.5/lib-dynload/ 
> PyQt4$ otool -L QtGui.so
> QtGui.so:
> 	/System/Library/Frameworks/Python.framework/Versions/2.5/Python  
> (compatibility version 2.5.0, current version 2.5.1)
> 	@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui  
> (compatibility version 4.3.0, current version 4.3.3)
> 	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon  
> (compatibility version 2.0.0, current version 136.0.0)
> 	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit  
> (compatibility version 45.0.0, current version 949.0.0)
> 	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore  
> (compatibility version 4.3.0, current version 4.3.3)
> 	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version  
> 1.2.3)
> 	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current  
> version 111.0.0)
> 	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current  
> version 7.4.0)
> 	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current  
> version 1.0.0)
>
> ~/Desktop/PyTalk.app/Contents/Frameworks/QtCore.framework/Versions/ 
> 4$ otool -L QtCore
> QtCore:
> 	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore  
> (compatibility version 4.3.0, current version 4.3.3)
> 	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version  
> 1.2.3)
> 	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current  
> version 111.0.0)
> 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ 
> ApplicationServices (compatibility version 1.0.0, current version  
> 34.0.0)
> 	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current  
> version 7.4.0)
> 	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current  
> version 1.0.0)
> 	/System/Library/Frameworks/CoreServices.framework/Versions/A/ 
> CoreServices (compatibility version 1.0.0, current version 32.0.0)
> 	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/ 
> CoreFoundation (compatibility version 150.0.0, current version  
> 476.0.0)
>
> ~/Desktop/PyTalk.app/Contents/Frameworks/QtGui.framework/Versions/4$  
> otool -L QtGui
> QtGui:
> 	@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui  
> (compatibility version 4.3.0, current version 4.3.3)
> 	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon  
> (compatibility version 2.0.0, current version 136.0.0)
> 	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit  
> (compatibility version 45.0.0, current version 949.0.0)
> 	@executable_path/../MacOS/../MacOS/../MacOS/../MacOS/../Frameworks/ 
> QtCore.framework/Versions/4/QtCore (compatibility version 4.3.0,  
> current version 4.3.3)
> 	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version  
> 1.2.3)
> 	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current  
> version 111.0.0)
> 	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ 
> ApplicationServices (compatibility version 1.0.0, current version  
> 34.0.0)
> 	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current  
> version 7.4.0)
> 	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current  
> version 1.0.0)
> 	/System/Library/Frameworks/CoreServices.framework/Versions/A/ 
> CoreServices (compatibility version 1.0.0, current version 32.0.0)
> 	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current  
> version 227.0.0)
> 	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/ 
> CoreFoundation (compatibility version 150.0.0, current version  
> 476.0.0)
> 	/System/Library/Frameworks/Foundation.framework/Versions/C/ 
> Foundation (compatibility version 300.0.0, current version 677.1.0)
>
> Now I have a dmg with my APP in it.
> Everything looks good, but when I start the APP, I still get this  
> very strange message :
> PyTalk Error
> An unexpected error has occurred during execution of the main script
>
> ImportError: '/System/Library/Frameworks/Python.framework/Versions/ 
> 2.5/lib/python2.5/lib-dynload/PyQt4/QtGui.so' not found
>
> If I look in the console, I get these informations:
> 26/01/08 15:20:44 [0x0-0x162162].fr.trunat.pytalk[3070]   File "/ 
> Users/natim/Desktop/PyTalk.app/Contents/Resources/pytalk.py", line  
> 4, in <module>
> 26/01/08 15:20:44 [0x0-0x162162].fr.trunat.pytalk[3070]     from  
> PyQt4.QtGui import *
> 26/01/08 15:20:44 [0x0-0x162162].fr.trunat.pytalk[3070]   File  
> "PyQt4/QtGui.pyo", line 18, in <module>
> 26/01/08 15:20:44 [0x0-0x162162].fr.trunat.pytalk[3070]   File  
> "PyQt4/QtGui.pyo", line 15, in __load
> 26/01/08 15:20:44 [0x0-0x162162].fr.trunat.pytalk[3070] ImportError:  
> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/lib-dynload/PyQt4/QtGui.so' not found
>
> I didn't find the PyQt4/QtGui.pyo file in my Computer. But I find it  
> on the site-package?	
> As join files, you can get my osx_installer.py script and the two  
> pyo files
>
> <QtCore.pyo><QtGui.pyo><osx_installer.py>
>
> Thank you for your help
>
> Natim




More information about the PyQt mailing list