Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.15.1
-
None
-
>pip list
Package Version
------------------------- ---------
altgraph 0.17
certifi 2020.6.20
click 7.1.2
cycler 0.10.0
future 0.18.2
kiwisolver 1.2.0
matplotlib 3.3.2
numpy 1.19.2
pandas 1.1.2
pandasql 0.7.3
pefile 2019.4.18
Pillow 7.2.0
pip 20.2.3
pip-tools 5.3.1
pyinstaller 4.0
pyinstaller-hooks-contrib 2020.8
pyparsing 2.4.7
pyqtgraph 0.11.0
PySide2 5.15.1
python-dateutil 2.8.1
pytz 2020.1
pywin32-ctypes 0.2.0
setuptools 50.3.0
shiboken2 5.15.1
six 1.15.0
spatialite 0.0.3
SQLAlchemy 1.3.19
>pip list Package Version ------------------------- --------- altgraph 0.17 certifi 2020.6.20 click 7.1.2 cycler 0.10.0 future 0.18.2 kiwisolver 1.2.0 matplotlib 3.3.2 numpy 1.19.2 pandas 1.1.2 pandasql 0.7.3 pefile 2019.4.18 Pillow 7.2.0 pip 20.2.3 pip-tools 5.3.1 pyinstaller 4.0 pyinstaller-hooks-contrib 2020.8 pyparsing 2.4.7 pyqtgraph 0.11.0 PySide2 5.15.1 python-dateutil 2.8.1 pytz 2020.1 pywin32-ctypes 0.2.0 setuptools 50.3.0 shiboken2 5.15.1 six 1.15.0 spatialite 0.0.3 SQLAlchemy 1.3.19
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