same problem but QPSQL DRIVER NOT LOADED
- 
- 
@12bibi12 Set QT_DEBUG_PLUGINS before starting your app and check the app output then. See https://doc.qt.io/qt-6/debug.html 
- 
@12bibi12 Set QT_DEBUG_PLUGINS before starting your app and check the app output then. See https://doc.qt.io/qt-6/debug.html 
- 
- 
@JonB are you talking about this https://doc.qt.io/qt-6/debug.html 
- 
@12bibi12 if you are using Qt Creator, go to the Run part of the Project panel and set the environment variable there. 
- 
@SGaist I get this problem QSqlDatabase: QPSQL driver not loaded 
 QSqlDatabase: available drivers: QSQLITE QODBC QPSQL
 "Driver not loaded Driver not loaded"@12bibi12 
 That is the output we would expect if you do not haveQT_DEBUG_PLUGINS=1environment variable set, which should produce a lot of detailed information. How did you set that environment variable in the run environment for your application, did you follow what we said above?
- 
@12bibi12 
 That is the output we would expect if you do not haveQT_DEBUG_PLUGINS=1environment variable set, which should produce a lot of detailed information. How did you set that environment variable in the run environment for your application, did you follow what we said above?
- 
@JonB yes, in run I scrolled down to Environment, then build environment. then I choose add. in Variable I wrote QT_DEBUG_PLUGINS and in value I wrote 1 @12bibi12 said in same problem but QPSQL DRIVER NOT LOADED: then build environment We explained it is not a build time variable, it's a run-time variable. That's why it needs to go into the Run environment settings from Creator, not the Build ones. 
- 
@12bibi12 said in same problem but QPSQL DRIVER NOT LOADED: then build environment We explained it is not a build time variable, it's a run-time variable. That's why it needs to go into the Run environment settings from Creator, not the Build ones. @JonB I click the project category. in build&run I choose the one for Mac. then I choose Run. in Run settings I can see 8 different subcategories. Deployment, run, environment,custom output parses, debugger settings, performance analyzer settings, valgrind settings, qml profiler settings. I chosed the Environment subcategory, in it I can choose different environment: clean-, system - and build environment. which one should I choose of these? 
- 
@JonB I click the project category. in build&run I choose the one for Mac. then I choose Run. in Run settings I can see 8 different subcategories. Deployment, run, environment,custom output parses, debugger settings, performance analyzer settings, valgrind settings, qml profiler settings. I chosed the Environment subcategory, in it I can choose different environment: clean-, system - and build environment. which one should I choose of these? 
- 
@SGaist okay in run there is command line arguments and other different options like working directory. do I put In QT_DEBUG_PLUGINS =1 in command line argument ? sorry but i am a beginner who is trying to work on a school project @12bibi12 
 Google:qt creator run environment variablesSpecifying Run Settings | Qt Creator Manual Qt https://doc.qt.io › qtcreator › creator-run-settings To run with special environment variables set up, select them in the Run Environment section. For more information, see Selecting the Run Environment. https://doc.qt.io/qtcreator/creator-run-settings.html#selecting-the-run-environment 
- 
@12bibi12 
 Google:qt creator run environment variablesSpecifying Run Settings | Qt Creator Manual Qt https://doc.qt.io › qtcreator › creator-run-settings To run with special environment variables set up, select them in the Run Environment section. For more information, see Selecting the Run Environment. https://doc.qt.io/qtcreator/creator-run-settings.html#selecting-the-run-environment @JonB I got this: Detected system locale encoding (US-ASCII, locale "C") is not UTF-8. 
 Qt shall use a UTF-8 locale ("UTF-8") instead. If this causes problems,
 reconfigure your locale. See the locale(1) manual for more information.
 qt.core.plugin.factoryloader: checking directory path "/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers" ...
 qt.core.plugin.factoryloader: looking at "/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlite.dylib"
 qt.core.plugin.loader: Found metadata in lib /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlite.dylib, metadata=
 {
 "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
 "MetaData": {
 "Keys": [
 "QSQLITE"
 ]
 },
 "archlevel": 0,
 "className": "QSQLiteDriverPlugin",
 "debug": false,
 "version": 394240
 }qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QSQLITE") 
 qt.core.plugin.factoryloader: looking at "/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlodbc.dylib"
 qt.core.plugin.loader: Found metadata in lib /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlodbc.dylib, metadata=
 {
 "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
 "MetaData": {
 "Keys": [
 "QODBC"
 ]
 },
 "archlevel": 0,
 "className": "QODBCDriverPlugin",
 "debug": false,
 "version": 394240
 }qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QODBC") 
 qt.core.plugin.factoryloader: looking at "/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib"
 qt.core.plugin.loader: Found metadata in lib /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib, metadata=
 {
 "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
 "MetaData": {
 "Keys": [
 "QPSQL"
 ]
 },
 "archlevel": 0,
 "className": "QPSQLDriverPlugin",
 "debug": false,
 "version": 394240
 }qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QPSQL") 
 qt.core.plugin.factoryloader: checking directory path "/Users/hayssamalsaffar/build-testing-Qt_6_4_3_for_macOS-Debug/testing.app/Contents/MacOS/sqldrivers" ...
 qt.core.library: "/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib" cannot load: Cannot load library /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib: (dlopen(/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib, 0x0085): Library not loaded: /Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib
 Referenced from: <24BC2DDB-7D4E-30A3-A970-DD116917D15D> /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib
 Reason: tried: '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtWidgets.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtWidgets.framework/Versions/A/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtSql.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtSql.framework/Versions/A/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtGui.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtGui.framework/Versions/A/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/build-testing-Qt_6_4_3_for_macOS-Debug/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/build-testing-Qt_6_4_3_for_macOS-Debug/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtCore.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtCore.framework/Versions/A/libpq.5.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5_debug.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5_debug.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5_debug.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/usr/local/lib/libpq.5_debug.dylib' (no such file), '/usr/local/lib/libpq.5.dylib' (no such file), '/usr/lib/libpq.5_debug.dylib' (no such file, not in dyld cache), '/usr/lib/libpq.5.dylib' (no such file, not in dyld cache))
 qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib" : "Cannot load library /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib: (dlopen(/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib, 0x0085): Library not loaded: /Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib\n Referenced from: <24BC2DDB-7D4E-30A3-A970-DD116917D15D> /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib\n Reason: tried: '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtWidgets.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtWidgets.framework/Versions/A/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtSql.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtSql.framework/Versions/A/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtGui.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtGui.framework/Versions/A/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/build-testing-Qt_6_4_3_for_macOS-Debug/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/build-testing-Qt_6_4_3_for_macOS-Debug/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtCore.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtCore.framework/Versions/A/libpq.5.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5_debug.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5_debug.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5_debug.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/usr/local/lib/libpq.5_debug.dylib' (no such file), '/usr/local/lib/libpq.5.dylib' (no such file), '/usr/lib/libpq.5_debug.dylib' (no such file, not in dyld cache), '/usr/lib/libpq.5.dylib' (no such file, not in dyld cache))"
 QSqlDatabase: QPSQL driver not loaded
 QSqlDatabase: available drivers: QSQLITE QODBC QPSQL
 "Driver not loaded Driver not loaded"
- 
@JonB I got this: Detected system locale encoding (US-ASCII, locale "C") is not UTF-8. 
 Qt shall use a UTF-8 locale ("UTF-8") instead. If this causes problems,
 reconfigure your locale. See the locale(1) manual for more information.
 qt.core.plugin.factoryloader: checking directory path "/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers" ...
 qt.core.plugin.factoryloader: looking at "/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlite.dylib"
 qt.core.plugin.loader: Found metadata in lib /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlite.dylib, metadata=
 {
 "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
 "MetaData": {
 "Keys": [
 "QSQLITE"
 ]
 },
 "archlevel": 0,
 "className": "QSQLiteDriverPlugin",
 "debug": false,
 "version": 394240
 }qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QSQLITE") 
 qt.core.plugin.factoryloader: looking at "/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlodbc.dylib"
 qt.core.plugin.loader: Found metadata in lib /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlodbc.dylib, metadata=
 {
 "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
 "MetaData": {
 "Keys": [
 "QODBC"
 ]
 },
 "archlevel": 0,
 "className": "QODBCDriverPlugin",
 "debug": false,
 "version": 394240
 }qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QODBC") 
 qt.core.plugin.factoryloader: looking at "/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib"
 qt.core.plugin.loader: Found metadata in lib /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib, metadata=
 {
 "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
 "MetaData": {
 "Keys": [
 "QPSQL"
 ]
 },
 "archlevel": 0,
 "className": "QPSQLDriverPlugin",
 "debug": false,
 "version": 394240
 }qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QPSQL") 
 qt.core.plugin.factoryloader: checking directory path "/Users/hayssamalsaffar/build-testing-Qt_6_4_3_for_macOS-Debug/testing.app/Contents/MacOS/sqldrivers" ...
 qt.core.library: "/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib" cannot load: Cannot load library /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib: (dlopen(/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib, 0x0085): Library not loaded: /Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib
 Referenced from: <24BC2DDB-7D4E-30A3-A970-DD116917D15D> /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib
 Reason: tried: '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtWidgets.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtWidgets.framework/Versions/A/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtSql.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtSql.framework/Versions/A/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtGui.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtGui.framework/Versions/A/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/build-testing-Qt_6_4_3_for_macOS-Debug/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/build-testing-Qt_6_4_3_for_macOS-Debug/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtCore.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtCore.framework/Versions/A/libpq.5.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5_debug.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5_debug.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5_debug.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/usr/local/lib/libpq.5_debug.dylib' (no such file), '/usr/local/lib/libpq.5.dylib' (no such file), '/usr/lib/libpq.5_debug.dylib' (no such file, not in dyld cache), '/usr/lib/libpq.5.dylib' (no such file, not in dyld cache))
 qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib" : "Cannot load library /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib: (dlopen(/Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib, 0x0085): Library not loaded: /Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib\n Referenced from: <24BC2DDB-7D4E-30A3-A970-DD116917D15D> /Users/hayssamalsaffar/Qt/6.4.3/macos/plugins/sqldrivers/libqsqlpsql.dylib\n Reason: tried: '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtWidgets.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtWidgets.framework/Versions/A/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtSql.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtSql.framework/Versions/A/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtGui.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtGui.framework/Versions/A/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/build-testing-Qt_6_4_3_for_macOS-Debug/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/build-testing-Qt_6_4_3_for_macOS-Debug/libpq.5.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtCore.framework/Versions/A/libpq.5_debug.dylib' (no such file), '/Users/hayssamalsaffar/Qt/6.4.3/macos/lib/QtCore.framework/Versions/A/libpq.5.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5_debug.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5_debug.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5_debug.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/usr/local/lib/libpq.5_debug.dylib' (no such file), '/usr/local/lib/libpq.5.dylib' (no such file), '/usr/lib/libpq.5_debug.dylib' (no such file, not in dyld cache), '/usr/lib/libpq.5.dylib' (no such file, not in dyld cache))"
 QSqlDatabase: QPSQL driver not loaded
 QSqlDatabase: available drivers: QSQLITE QODBC QPSQL
 "Driver not loaded Driver not loaded"Do you have PostgreSQL installed in some fashion ? 
 If so, how and where did you install it ?
- 
Do you have PostgreSQL installed in some fashion ? 
 If so, how and where did you install it ?
- 
@SGaist i have something named postgre https://postgresapp.com. its installed in my applications. /Applications/Postgres.app/Contents From the debug log, I would guess that you installed the 15 version of the application. You have two options here: - Install version 14
- Use install_name_toolto update the/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylibpath to use the library from your installedPostgres.app
 
- 
From the debug log, I would guess that you installed the 15 version of the application. You have two options here: - Install version 14
- Use install_name_toolto update the/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylibpath to use the library from your installedPostgres.app
 
 

