Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Why is the Qt Plugin sqldriver 'libqsqlpsql.dylib' looking for Postgres v14?
Forum Updated to NodeBB v4.3 + New Features

Why is the Qt Plugin sqldriver 'libqsqlpsql.dylib' looking for Postgres v14?

Scheduled Pinned Locked Moved Unsolved Qt for Python
6 Posts 2 Posters 718 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pipper
    wrote on last edited by
    #1

    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))

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      That's because the plugin was built against that version of PostgreSQL. It does not use psychopg at all.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      P 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        That's because the plugin was built against that version of PostgreSQL. It does not use psychopg at all.

        P Offline
        P Offline
        Pipper
        wrote on last edited by Pipper
        #3

        @SGaist If I downloaded the PySide6 package using pip, how would I know (or how can I tell) what it was built against? Maybe I should be asking a different question. Is the plugin built prior to downloading the package?

        SGaistS 1 Reply Last reply
        0
        • P Pipper

          @SGaist If I downloaded the PySide6 package using pip, how would I know (or how can I tell) what it was built against? Maybe I should be asking a different question. Is the plugin built prior to downloading the package?

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          P 1 Reply Last reply
          0
          • SGaistS SGaist

            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.

            P Offline
            P Offline
            Pipper
            wrote on last edited by
            #5

            @SGaist Thanks again for your explanation. Really great. I previously had PG v14 installed on my system and it was a coincidence that my app was working.

            SGaistS 1 Reply Last reply
            0
            • P Pipper

              @SGaist Thanks again for your explanation. Really great. I previously had PG v14 installed on my system and it was a coincidence that my app was working.

              SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @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 :-)

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved