[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: QSqlDatabase: QPSQL driver not loaded
From: Rich Shepard <rshepard () appl-ecosys ! com>
Date: 2021-05-20 17:18:46
Message-ID: alpine.LNX.2.20.2105200949310.6045 () salmo ! appl-ecosys ! com
[Download RAW message or body]
Running PyQt5-5.13.2 on Slackware64-14.2 with Postgresql-12.2 and
Python3-3.7.2. Also installed are /usr/lib/qt/include/QtSql/QPSQLDriver,
/usr/lib/qt/include/QtSql/QPSQLResult,
/usr/lib64/qt/include/QtSql/QPSQLDriver, and
/usr/lib64/qt/include/QtSql/QPSQLResult.
Developing my first PyQt5/SQL database application and working on a simple
module (to add a new activity type to the database table) I get these
errors:
$ python activitytype.py
QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE
The database connection code is:
# Set up database connection
self.db = qts.QSqlDatabase.addDatabase('QPSQL')
self.db.setDatabaseName('bustrac')
if not self.db.open():
error = self.db.lastError().text()
qtw.QMessageBox.critical(
None, 'DB Connection Error',
'Could not open database file: '
f'{error}')
sys.exit(1)
The build scripts for Qt5 and python3-PyQt4 have no configuration option for
database drivers.
The web page <https://doc.qt.io/qtforpython/overviews/sql-driver.html>
describes building on Windows, not linux.
1. How do I learn what SQL drivers are installed (other than QSQLITE)?
2. How do I make the QPSQLDriver available for use?
TIA,
Rich
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic