[PyQt] ANN: PyQt v5.8 and SIP v4.19.1 Released

Phil Thompson phil at riverbankcomputing.com
Fri Feb 17 21:56:00 GMT 2017


On 17 Feb 2017, at 7:37 pm, Sibylle Koczian <nulla.epistola at web.de> wrote:
> 
> Am 17.02.2017 um 15:48 schrieb Phil Thompson:
>>> I can't get the QPSQL driver to work any more.
>>> 
>>> Versions of everything: OS is Windows 10, Python 3.5.2, PostgreSQL
>>> 9.6.1, PyQt 5.7 installed from PyPi, all of it 64 bit.
>> 
>> The old PyQt installers contained a locally built copy of Qt that had
>> the database specific drivers statically compiled with the Qt SQL
>> plugins. The new wheels use the Qt builds provided by the Qt project
>> - those builds use the database specific drivers but don't include
>> them. You need to obtain and install them yourself - usually by
>> installing the database package itself.
>> 
> 
> Thank you for your explanation - but I don't fully understand it: "installing the database package itself" - does that mean the PostgreSQL server? That is installed and runs on the same machine I'm trying to use QtSql on. And what exactly are the "database specific drivers"?

In the case of PostgreSQL I think it is lipq.dll (or maybe libpg.dll). It is called by the Qt plugin - you need both.

> The subdirectory "...\Qt\plugins\sqldrivers" of my PyQt installation contains the file qsqlpsql.dll. That is the right plugin, isn't it? Do I have to rebuild it using the instructions in the Qt documentation, to tell the plugin about the location of PostgreSQL on my machine? But that can't be right: it would mean repeating this with every update of either PyQt or PostgreSQL???

...or Qt. This is a Qt issue, nothing to do with PyQt. I assume you just need to make sure the directory containing the PostgreSQL DLL is on PATH.

> Please clarify - I'm quite inexperienced with compiling and building things myself on Windows.
> 
> By the way, psycopg2 connects to my databases out of the box. So I can use SQLAlchemy with PyQt5 - but QtSql would be simpler.

Then it must have the DLL statically linked, or includes a local copy of the DLL, or it implements the wire protocol itself.

Phil


More information about the PyQt mailing list