当我想将我的 Linux PyQt5 项目与 QOCI 连接时,它会显示此消息:
QSqlDatabase: QOCI driver not loaded
我该如何解决?
最佳答案
首先在您的 Linux 上查找可用的驱动程序:
from PyQt5 import QtSql
QtSql.QSqlDatabase().drivers()
在带有 python 3.5 和 pyqt5 的 ubuntu 16.04 上,我只得到:
['QSQLITE']
QtSql contains classes that integrate with SQL databases. It includes editable data models for database tables that can be used with GUI classes. It also includes an implementation of SQLite.
所以我想,在 pyqt5 中只有 SQLite3 而没有 Oracle 支持。也许你可以使用 python 和 cx_oracle相反
关于linux - 连接到 PyQT5 中的 QOCI Linux 驱动程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39172311/