views:

46

answers:

2

I am running Ubuntu 10.04 Lucid and am developing a application in QT using Python. Today I tried to create a database binding to a SQLite database via QtSQL.QAddDatabase and got the following error:

QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers: QMYSQL3 QMYSQL

So obviously I don't have the SQLite driver...how can I add it to my install? I installed PySide to see if it included it (via the PPA)...same thing...no SQLite...maybe I can reconfigure and build the python-qt-sql package but I need instructions on how to to it...

A: 

Does this help?

$> apt-cache search qt mysql
libqt3-mt-mysql - MySQL database driver for Qt3 (Threaded)
qtstalker - commodity and stock market charting and technical analysis
tora - A graphical toolkit for database developers and administrators
libqt4-sql-mysql - Qt 4 MySQL database driver

Sounds like the packages you need are there!

Edit: right, you said SQLite, sorry. Here:

$> apt-cache search qt sqlite
libqt3-mt-sqlite - SQLite database driver for Qt3 (Threaded)
sqlitebrowser - GUI editor for SQLite databases
strigi-daemon - fast indexing and searching tool for your personal data (daemon)
libqt4-sql-sqlite - Qt 4 SQLite 3 database driver
libqt4-sql-sqlite2 - Qt 4 SQLite 2 database driver

You can use the apt-cache tool to look for packages matching expressions. I posted the code above so you could do this by yourself in the future :).

Santiago Lezica
I need SQLite not MySQL...
Icoo
lol ok, edited, look above.
Santiago Lezica
A: 

Got it solved...the QT4 SQLite driver was missing...used this:

sudo aptitude install libqt4-sql-sqlite

That solved it and now it works in PyQT and PySide.

Icoo