Why is the Qt Plugin sqldriver 'libqsqlpsql.dylib' looking for Postgres v14?
-
I am getting this error when I try to run my app without the DYLD_LIBRARY_PATH set. This isn't a problem per se, since DYLD_LIBRARY_PATH is normally set. However, I can't understand why it looks for Postgres v14 since it's not in my PATH and no longer on my system. I re-installed PySide6 on my Mac as well as psycopg2 just in case. What am I missing in my configuration? Thanks for taking a look at this error.
qt.core.plugin.factoryloader: looking at "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/PySide6/Qt/plugins/sqldrivers/libqsqlpsql.dylib"
qt.core.plugin.loader: Found metadata in lib /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/PySide6/Qt/plugins/sqldrivers/libqsqlpsql.dylib, 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.plugin.factoryloader: checking directory path "/Library/Frameworks/Python.framework/Versions/3.11/Resources/Python.app/Contents/MacOS/sqldrivers" ...
qt.core.library: "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/PySide6/Qt/plugins/sqldrivers/libqsqlpsql.dylib" cannot load: Cannot load library /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/PySide6/Qt/plugins/sqldrivers/libqsqlpsql.dylib: (dlopen(/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/PySide6/Qt/plugins/sqldrivers/libqsqlpsql.dylib, 0x0085): Library not loaded: /Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib
Referenced from: <E20C116A-935C-34D7-8C7B-6B4FDA0B15A5> /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/PySide6/Qt/plugins/sqldrivers/libqsqlpsql.dylib
Reason: tried: '/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.dylib' (no such file), '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' (no such file), '/usr/lib/libpq.5.dylib' (no such file, not in dyld cache)) -
Hi,
That's because the plugin was built against that version of PostgreSQL. It does not use psychopg at all.
-
Yes it is.
The list of paths you see with the failure is all the paths that are checked for presence of the PostgreSQL client library. You need to have it available on your system. As you can see the PostgresApp is one of the solution. It's usually a good one as you can test and validate your application on your system.
If you have the client library in a different path, you can also update the plugin with install_name_tool.
-
@Pipper you're welcome ! If that answers your question, please mark the thread as solved using the "Topic Tools" button or the three dotted menu beside the answer your deem correct so other forum users may know a solution has been found :-)