[PyQt] No MySQL driver on Windows PyQt4?

duncan duncan duncan73 at gmail.com
Wed Dec 10 11:42:42 GMT 2008


2008/12/10 duncan duncan <duncan73 at gmail.com>

>
>
> On Wed, Dec 10, 2008 at 10:29 AM, Phil Thompson <
> phil at riverbankcomputing.com> wrote:
>
>> On Wed, 10 Dec 2008 10:05:12 +0100, "piotr maliński" <riklaunim at gmail.com
>> >
>> wrote:
>> > I've installed latest PyQt4 release for Windows and the problem is it
>> > doesn't has MySQL driver (QSqlDatabase: QMYSQL driver not loaded). There
>> is
>> > only SQLITE and ODBC...
>>
>> Correct - you will have to compile Qt and PyQt yourself with the necessary
>> support.
>>
>
>
> I have some problems also using the SQLITE drivers under windows.
>
> I installed the binary package for Qt and PyQt4, but then I get this error:
>
>
> ------
> G:\home>c:\Python25\python.exe
> Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
> (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from PyQt4.QtSql import *
> >>> QSqlDatabase.isDriverAvaible("QSQLITE")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> AttributeError: isDriverAvaible
> >>> QSqlDatabase.isDriverAvailable("QSQLITE")
> False
> ------
>
>
> In the directory C:\Python25\Lib\site-packages\PyQt4\plugins\sqldrivers I
> have these files:
>
> libqsqlite4.a
> libqsqlited4.a
> libqsqlodbc4.a
> libqsqlodbcd4.a
> qsqlite4.dll
> qsqlited4.dll
> qsqlodbc4.dll
> qsqlodbcd4.dll
>
>
> while in the directory  C:\Qt\4.4.3\plugins\sqldrivers I have these files:
>
> libqsqlite4.a
> libqsqlited4.a
> libqsqlodbc4.a
> libqsqlodbcd4.a
> qsqlite4.dll
> qsqlited4.dll
> qsqlodbc4.dll
> qsqlodbcd4.dll
>
>
> The demo from the Qt4 installation works fine
>
> Any hints ?
>
> bye
> Gianluca
>

Another information:

the snippet of code I use is this

----
app = QApplication(sys.argv)
db = QSqlDatabase.addDatabase("QSQLITE")
db.setDatabaseName("chiamami.db")
-----

and the output of the program is

G:\home\chiamami>chiamami.py
QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers:
QString::arg: Argument missing: Database Error, Driver not loaded Driver not
loaded

So I suppose that for some reasons PyQt4 and/or Qt4 don't find the .dll
files.

bye
Gianluca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20081210/34f3d9e6/attachment.html


More information about the PyQt mailing list