QMYSQL driver: Anaconda / Linux
-
Kia ora
I've read so many helpful articles on the oft-encountered issue of libqsqlmysql.so and the QMYSQL driver not being found. Thank you for the support that these have been.
I'm not able to sort this current scenario and wonder if anyone can advise?
I am attempting to achieve this with Linux and Anaconda (for reasons too boring to go into unless these are of interest!). Anaconda has a pyqt5 package, which is awesome.I have compiled and installed libqsqlmysql.so from the matching version of QT (5.9.7) - however, it throws this error:
python: symbol lookup error: /opt/anaconda3/plugins/sqldrivers/libqsqlmysql.so: undefined symbol: _ZdlPvm, version Qt_5
I've had a thorough search, but have not been able to find a similar case, and wonder if anyone has the genius to point me in the right direction for a fix. Many hours fruitlessly trying to fix it myself to no avail.
Interestingly, just prior to throwing this error:
q.exec()
TypeError: exec(self, str): not enough arguments(the call being to execute a prepared query).
Very hopeful for any help here...
Thank you,
Jamie
-
Kia ora
I've read so many helpful articles on the oft-encountered issue of libqsqlmysql.so and the QMYSQL driver not being found. Thank you for the support that these have been.
I'm not able to sort this current scenario and wonder if anyone can advise?
I am attempting to achieve this with Linux and Anaconda (for reasons too boring to go into unless these are of interest!). Anaconda has a pyqt5 package, which is awesome.I have compiled and installed libqsqlmysql.so from the matching version of QT (5.9.7) - however, it throws this error:
python: symbol lookup error: /opt/anaconda3/plugins/sqldrivers/libqsqlmysql.so: undefined symbol: _ZdlPvm, version Qt_5
I've had a thorough search, but have not been able to find a similar case, and wonder if anyone has the genius to point me in the right direction for a fix. Many hours fruitlessly trying to fix it myself to no avail.
Interestingly, just prior to throwing this error:
q.exec()
TypeError: exec(self, str): not enough arguments(the call being to execute a prepared query).
Very hopeful for any help here...
Thank you,
Jamie
@Jamie-Allen
Are you needing to compile Qt/MySql support from sources for yourself? You don't say anything about which Linux distro you are using, I have always used the version of Qt which comes with Ubuntu release and have fetched anything I need viaapt-get, no sources/compilation of anything. -
Thanks, Jon - really appreciate your swift response :))
The distro is Ubuntu 20.04.1 - and it does indeed come with a packaged version of the library. Curiously, when I've attempted using that library:
"Failed to extract plugin meta data from '/opt/anaconda3/plugins/sqldrivers/libqsqlmysql.so'"
not a plugin
QSqlDatabase: QMYSQL driver not loadedThank you again, Jamie
-
Thanks, Jon - really appreciate your swift response :))
The distro is Ubuntu 20.04.1 - and it does indeed come with a packaged version of the library. Curiously, when I've attempted using that library:
"Failed to extract plugin meta data from '/opt/anaconda3/plugins/sqldrivers/libqsqlmysql.so'"
not a plugin
QSqlDatabase: QMYSQL driver not loadedThank you again, Jamie
@Jamie-Allen said in QMYSQL driver: Anaconda / Linux:
Thanks, Jon - really appreciate your swift response :))
The distro is Ubuntu 20.04.1 - and it does indeed come with a packaged version of the library. Curiously, when I've attempted using that library:
"Failed to extract plugin meta data from '/opt/anaconda3/plugins/sqldrivers/libqsqlmysql.so'"
not a plugin
QSqlDatabase: QMYSQL driver not loadedThank you again, Jamie
PS - Still more interestingly, if I use the apt-installed version of Python (rather than Anaconda's version), that library works quite happily (but for this application, sadly I have to use Anaconda). Here's the debug output - demonstrating that the meta data most definitely present:
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlmysql.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlmysql.so, metadata=
{
"IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
"MetaData": {
"Keys": [
"QMYSQL3",
"QMYSQL"
]
},
"archreq": 0,
"className": "QMYSQLDriverPlugin",
"debug": false,
"version": 330752
}I guess it's a library incompatibility problem :(
With thanks again, Jamie -
@Jamie-Allen said in QMYSQL driver: Anaconda / Linux:
Thanks, Jon - really appreciate your swift response :))
The distro is Ubuntu 20.04.1 - and it does indeed come with a packaged version of the library. Curiously, when I've attempted using that library:
"Failed to extract plugin meta data from '/opt/anaconda3/plugins/sqldrivers/libqsqlmysql.so'"
not a plugin
QSqlDatabase: QMYSQL driver not loadedThank you again, Jamie
PS - Still more interestingly, if I use the apt-installed version of Python (rather than Anaconda's version), that library works quite happily (but for this application, sadly I have to use Anaconda). Here's the debug output - demonstrating that the meta data most definitely present:
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlmysql.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlmysql.so, metadata=
{
"IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
"MetaData": {
"Keys": [
"QMYSQL3",
"QMYSQL"
]
},
"archreq": 0,
"className": "QMYSQLDriverPlugin",
"debug": false,
"version": 330752
}I guess it's a library incompatibility problem :(
With thanks again, JamieHa! Joy!
Just solved this by using Anaconda's qmake rather than the qt-installed qmake. Doh!
The exec() issue fixed by using exec_()
Thanks again for your time, Jamie
-
Ha! Joy!
Just solved this by using Anaconda's qmake rather than the qt-installed qmake. Doh!
The exec() issue fixed by using exec_()
Thanks again for your time, Jamie
Thanks again for your time, Jamie
Thanking yourself in a post is the first sign of madness :)
exec()should be acceptable at least in PyQt. I guess you're using PySide if it insists onexec_()? I thought they might have allowed for that by now.... -
Thanks again for your time, Jamie
Thanking yourself in a post is the first sign of madness :)
exec()should be acceptable at least in PyQt. I guess you're using PySide if it insists onexec_()? I thought they might have allowed for that by now....@JonB :))) I was actually thanking you! That's the bizarre thing... I'm not using PySide. Very odd.
However, at least it's working. Currently attempting the same on Mac as the application has to deployed on that platform too (and also with Anaconda)... Similar issues there, and I'll update if/when I'm able to find a solution, for anyone trying the same process...
Jamie :)