Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver is found but not loaded #36

Open
A-Little-on-the-Nose opened this issue Jan 16, 2024 · 10 comments
Open

Driver is found but not loaded #36

A-Little-on-the-Nose opened this issue Jan 16, 2024 · 10 comments

Comments

@A-Little-on-the-Nose
Copy link

Hello,

I have put the contents of sqldrivers into the sqldrivers folder inside the python folder that was in AppData. Now I don't know where excactly I should put the other files, so I put them into the folder before the sqldrivers folder of python (That is one of the folders I have added in path). It still doesn't load.
Also checked if the driver is the same version as my PyQt6 and it is both 6.1.

@A-Little-on-the-Nose
Copy link
Author

I installed the Open SSL and added it to path, and I found where libmysql is and added that one to path as well. But it still can't load the driver.

@thecodemonkey86
Copy link
Owner

Hi,
what exact version are you using? You can check that using pip list command. Does the environment variable QT_DEBUG_PLUGINS with value 1 provide any information why the driver can't be loaded while you run your project?

@A-Little-on-the-Nose
Copy link
Author

The version is PyQt6-Qt6 6.61. What do I need to enter in my powershell terminal to get the information from QT_DEBUG_PLUGINS?

@A-Little-on-the-Nose
Copy link
Author

A-Little-on-the-Nose commented Jan 16, 2024

qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QPSQL")
qt.core.plugin.factoryloader: checking directory path "C:/Users/.../AppData/Local/Programs/Python/Python311/sqldrivers" ...
qt.core.library: "C:/Users/.../AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlmysql.dll" cannot load: Cannot load library C:\Users...\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyQt6\Qt6\plugins\sqldrivers\qsqlmysql.dll: Das angegebene Modul wurde nicht gefunden.
qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "C:/Users/.../AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlmysql.dll" : "Cannot load library C:\Users\...\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyQt6\Qt6\plugins\sqldrivers\qsqlmysql.dll: Module not found."

@A-Little-on-the-Nose
Copy link
Author

The file is inside the right folder but it cant be loaded. Should I drop the other 3 files into the folder as well?

@thecodemonkey86
Copy link
Owner

Which of my releases are you using? I suggest that you try to analyse the issue using a dependency walker (e.g. https://github.com/lucasg/Dependencies) on qsqlmysql.dll

@A-Little-on-the-Nose
Copy link
Author

I am using the 6.6.1 version. Tomorrow I will try to have a look at the dependency walker.

@thecodemonkey86
Copy link
Owner

I meant if you are using MSVC or MinGW variant of 6.6.1. For Python you'll need the MSVC variant

@A-Little-on-the-Nose
Copy link
Author

A-Little-on-the-Nose commented Jan 17, 2024

I have switched to the MSVC-Version and now it shows me this. In the second line, it looks for the sql driver in a directory that I don't have. Could that be the problem?

@A-Little-on-the-Nose
Copy link
Author

So I tested it now in seperate class:

qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QMYSQL", "QMARIADB")
qt.core.plugin.factoryloader: looking at "C:/Users/.../AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlmysqld.dll"
qt.core.plugin.loader: Found metadata in lib C:/Users/.../AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlmysqld.dll, metadata=
{
"IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
"MetaData": {
"Keys": [
"QMYSQL",
"QMARIADB"
]
},
"archlevel": 0,
"className": "QMYSQLDriverPlugin",
"debug": true,
"version": 394752
}

qt.core.plugin.factoryloader: "The plugin 'C:/Users/.../AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlmysqld.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
not a plugin
qt.core.plugin.factoryloader: looking at "C:/Users/.../AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlodbc.dll"
qt.core.plugin.loader: Found metadata in lib C:/Users/.../AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlodbc.dll, metadata=
{
"IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
"MetaData": {
"Keys": [
"QODBC"
]
},
"archlevel": 0,
"className": "QODBCDriverPlugin",
"debug": false,
"version": 394752
}

qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QODBC")
qt.core.plugin.factoryloader: looking at "C:/Users/.../AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlpsql.dll"
qt.core.plugin.loader: Found metadata in lib C:/Users/.../AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlpsql.dll, metadata=
{
"IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
"MetaData": {
"Keys": [
"QPSQL"
]
},
"archlevel": 0,
"className": "QPSQLDriverPlugin",
"debug": false,
"version": 394752
}

qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QPSQL")
qt.core.library: "C:/Users/.../AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlmysql.dll" loaded library
"C:/Users/.../AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlmysql.dll" unloaded library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants