I'm trying to convert python code into a mac application with py2app. My python code uses PyQt4 to access a sqlite db. At run time (on a different mac from the one where I build the .app where there is no PyQt4+Qt4 installed) I get the error: Driver not loaded Unable to establish a database connection This example needs SQLite support ... On Windows, using py2exe, I had the same problem and I solved it coping: ...\Qt\version\plugins\sqldrivers\*.* to: ...\myApp\sqldrivers\*
On Mac I tried coping libqsqlite.dylib into: .../myApp/Contents/Frameworks/QtSql.framework/ and into: .../myApp/Contents/Frameworks/ but nothing changed. I tried with either these options: options = {'py2app': { "packages": ["encodings"], "includes":["sip", 'PyQt4.QtSvg'], 'excludes': ["Tkconstants","Tkinter","tcl"] } }, or options = {'py2app': { "packages": ["encodings"], "includes":["sip", 'PyQt4.QtSvg', 'PyQt4.QtSql'], 'excludes': ["Tkconstants","Tkinter","tcl"] } }, or options = {'py2app': { "packages": ["encodings"], "includes":["sip", "PyQt4", 'PyQt4.QtSvg', 'PyQt4.QtSql'], 'excludes': ["Tkconstants","Tkinter","tcl"] } }, but nothing changed. I tried also: options = {'py2app': { "packages": ["encodings"], "includes":["sip", "PyQt4._qt",'PyQt4.QtSvg'], 'excludes': ["Tkconstants","Tkinter","tcl"] } }, but in this case I get this error: File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py", line 548, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py", line 600, in run_normal mf = self.get_modulefinder() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py", line 508, in get_modulefinder debug=debug, File "build/bdist.macosx-10.3-i386/egg/modulegraph/find_modules.py", line 243, in find_modules find_needed_modules(mf, scripts, includes, packages) File "build/bdist.macosx-10.3-i386/egg/modulegraph/find_modules.py", line 171, in find_needed_modules mf.import_hook(mod) File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py", line 246, in import_hook m = self.load_tail(q, tail) File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py", line 309, in load_tail raise ImportError, "No module named " + mname ImportError: No module named PyQt4._qt > /Users/licia/dieta/build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py(309)load_tail() I'm working with: Python 2.5 under /Library/Frameworks Qt-4.3.4 under /usr/local/Trolltech/Qt-4.3.4 PyQt-4.3.3 Please, I need your help! Thank in advance. Ciao Licia -- View this message in context: http://www.nabble.com/-pythonmac-sig--Py2app-and-Driver-not-loaded-error-from-PyQt4%2Bsqlite-tp21610538p21610538.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig