Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1399

QPSQL - Driver not loaded

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Need More Info
    • Priority: Not Evaluated
    • Resolution: Incomplete
    • Affects Version/s: 5.15.1
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
    • Environment:
    • Platform/s:
      Windows

      Description

      When I try to open a db withthe QPSQL-Driver it fails with the error message: QSqlDatabase: QPSQL driver not loaded

       

      When I put the contents of the the postgreSQL ODBC driver (https://www.postgresql.org/ftp/odbc/versions/msi/) to the project folder, the code works well.

       

      from PySide2.QtCore import QCoreApplication
      from PySide2.QtSql import QSqlDatabase
      
      QCoreApplication()
      db = QSqlDatabase("QPSQL")
      # db-server, db and auth-data are not needed to show
      db.open()
      

       Error:

       

      python PgSqlTest.py
      QSqlDatabase: QPSQL driver not loaded
      QSqlDatabase: available drivers: QSQLITE QODBC QODBC3
      

      And with the files of the ODBC-Driver:

      False could not connect to server: Connection refused (0x0000274D/10061)
       Is the server running on host "localhost" (::1) and accepting
       TCP/IP connections on port 5432?
      could not connect to server: Connection refused (0x0000274D/10061)
       Is the server running on host "localhost" (127.0.0.1) and accepting
       TCP/IP connections on port 5432?
      QPSQL: Unable to connect

       

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            crmaurei Cristian Maureira-Fredes
            Reporter:
            doev do ev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes