Comments (6)
Might it be possible to do this conversation in german ?
Klar. Für mich sieht das so aus, als würde die qsqlmysql.dll immer noch nicht die libmysql.dll finden. Wie wurde der Pfad zur libmysql.dll in die PATH-Variable eingetragen? Falls über die Systemsteuerung, könnte es sein, dass man Windows neu starten muss, damit das überall greift. Ansonsten könnte evtl. noch Dependency Walker oder dessen modernere Alternative https://github.com/lucasg/Dependencies angewendet auf qsqlmysql.dll weiterhelfen
from qt_mysql_driver.
Hi,
try the following:
- ensure using
pip list
command that the correct PyQt6 version is installed - Copy
qsqlmysql.dll
from https://github.com/thecodemonkey86/qt_mysql_driver/files/11768056/qsqlmysql.dll_Qt_SQL_driver_6.5.1_MSVC2019_64-bit.zip toC:\Users\YOUR_USER_NAME_HERE\AppData\Local\Programs\Python\Python310\Lib\site-packages\PyQt6\Qt6\plugins\sqldrivers
, (assuming you use Python 3.10, otherwise adjust the path) and insert your user name into the path - Copy libmysql.dll, libcrypto-3-x64.dll and libssl-3-x64.dll from the zip to an arbitrary folder and add this folder to your PATH environment variable, either permanently via Windows Control Panel -> advanced system settings -> environment variables, or temporarily via command line
set PATH=%PATH%:C:\your\path
- make sure you set the QT_DEBUG_PLUGINS variable:
set QT_DEBUG_PLUGINS=1
in case it's not working yet. Maybe this reveals some hints, where Qt is looking for plugins for example - then run your project from command line e.g.
py main.py
from qt_mysql_driver.
Hi thanks for the fast answer.
I tryed the steps you just posted :)
But unfortunetly id doesnt work.
I got this debug output:
(only the last few lines where the code got the error)
qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QPSQL")
qt.core.plugin.factoryloader: checking directory path "C:/Users/USER/AppData/Local/Programs/Python/Python311/sqldrivers" ...
qt.core.library: "C:/Users/USER/AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlmysql.dll" cannot load: Cannot load library C:\Users\USER\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyQt6\Qt6\plugins\sqldrivers\qsqlmysql.dll: The specified module could not be found.
qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "C:/Users/USER/AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlmysql.dll" : "Cannot load library C:\Users\USER\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyQt6\Qt6\plugins\sqldrivers\qsqlmysql.dll: The specified module could not be found."
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL
Cannot establish a database connection, error: Driver not loaded Driver not loaded
qt.core.plugin.factoryloader: checking directory path "C:/Users/USER/AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/accessible" ...
qt.core.plugin.factoryloader: checking directory path "C:/Users/USER/AppData/Local/Programs/Python/Python311/accessible" ...
qt.core.plugin.factoryloader: checking directory path "C:/Users/USER/AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/accessiblebridge" ...
qt.core.plugin.factoryloader: checking directory path "C:/Users/USER/AppData/Local/Programs/Python/Python311/accessiblebridge" ...
Im running the code in vscode 2023. Using Python 3.11
I copied the qsqlmysql.dll in the corect path.
And added the other files to a directory and set the path in the envirment variables : C:\MySqlDriver
i dont know if im understanding something wrong. Might it be possible to do this conversation in german ?
Thanks in Advance !
from qt_mysql_driver.
I Double Checked the qsqlmysql.dll is in the correct folder and also the other 3 files are in the correct folder.
I tested it on a completly fresh Windows install. Just with PyQt6 installed and Packages needed for the code to run.
Did all the steps again and i unfortunetly got the same result.
I think im doing something wrong.
from qt_mysql_driver.
Wie wurde der Pfad zur libmysql.dll in die PATH-Variable eingetragen?
C:\MySqlDriver das ist der Path den ich angegeben habe. Dort sind die 3 lib files drin.
Im Python Folder habe ich dann halt die qsqlmysql.dll untergebracht wie angegeben.
Windows hatte ich Neu Gestartet danach. War auch mein erster verdacht das das zu Problemen führen könnte.
Der Dependency Walker hatt mir aufjedenfall was ausgespuckt. Anscheinend fehlt der Qt6Sql.dll und die QT6Core.dll
Habe den Path dahin hinzugefügt und siehe da :
qt.core.library: "C:/Users/USER/AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins/sqldrivers/qsqlmysql.dll" loaded library
Database Connected
💯 Du bist ein Held ! Ich danke dir so sehr !
from qt_mysql_driver.
For those who might have the Same problem as me even when importing every thing correctly and you stil got the same error.
As from @thecodemonkey86 Suggested Try Using https://github.com/lucasg/Dependencies and see if the Qt6Sql.dll and the Qt6Core.dll is not loaded properly.
if that is the Case you need to add this to your path:
\Tools\QtCreator\bin (there are the files hiding)
or \Tools\QtDesignStudio\bin
Then the qsqlmysql.dll can be read correctly and it will work.
It might be the Problem that i used Python 3.11 or Qt did not correctly got assigned to my Path.
from qt_mysql_driver.
Related Issues (20)
- 5.15.4 version? HOT 2
- MySQL: Unable to set the client character set to utf8 (""). Using 'utf8' instead. HOT 4
- OCI Driver HOT 2
- this is awesome HOT 1
- Qt5.9.9 MinGW 32bit? HOT 1
- Qt 6.2.3 HOT 2
- Could I share the Github file links? HOT 2
- How to use with PySide6? HOT 3
- 6.3.0测试过了,不起作用,找不出原因,请帮忙确认是否有人用过,谢谢 HOT 3
- mysql version
- Android MySQL HOT 3
- Thanks very much! qt6 version i can find neither mysql driver source code nor the mysql driver. It's useful to me! successed already HOT 1
- QSqlDriver::hasFeature(Transactions) returns false HOT 3
- Where are the QMYSQL drivers trying to find MySQL? HOT 6
- Guidance/instructions for adding files to PyInstaller package? HOT 1
- Any shot of getting a release for 5.15.7 HOT 3
- Compatibility question HOT 1
- Driver not loaded error. Are the plugins debug or release plugins? HOT 2
- the version of the sqldrivers in "qsqlmysql.dll driver 5.13.2 + libmysql MySQL 8.0" is actually 5.14.2 ! HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qt_mysql_driver.