[PyQt] Driver not loaded. - error accessing sqlite DB from a py2exe binary

IloChab ilochab at gmail.com
Sun Oct 14 18:45:59 BST 2007


I wrote an application that uses PyQt4 to access a sqlite DB.

Now I'm trying to convert it using py2exe and I found some problems.
The last one, that I'm not able to avoid, is that when I launch the
application's binary on a PC (that contains only a Python 2.5
installation and no QT4) I get an error trying to open the DB with
this code:

db = QtSql.QSqlDatabase.addDatabase("QSQLITE")
db.setDatabaseName(defines.DB_FILE)
if not db.open():
   # displays:
                  Driver not loaded.

I made many attempts changing options in my setup file but none of
them successfull.
The last one uses this options:

     options={"py2exe": {"includes":["sip",  'PyQt4.QtSql' ],
                         "packages": ["sqlite3",]}}

but I verified that neither QtSql, neither sqlite3 are usefull to
avoid the error.

I also copied manually all the Qt/4.2.2/plugins/sqldrivers .dll files to my
distribution directory but anything changed.

My development configuration is
Python 2.5
Qt4      4.2.2
PyQt    4.1.1

Any suggestion to solve this problem?

Thanks in advance.

Ciao.
Licia.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20071014/4e6471d6/attachment.html


More information about the PyQt mailing list