This is a static archive of the Python wiki, which was retired in February 2026 due to lack of usage and the resources necessary to serve it — predominately to bots, crawlers, and LLM companies.
Pages are preserved as they were at the time of archival. For current information, please visit python.org.
If a change to this archive is absolutely needed, requests can be made via the infrastructure@python.org mailing list.

Overview

These instructions describe how to configure Qt on Windows so the drivers for PostgreSQL are built and usable by PyQt4. They do not go into detail on how to build Qt, SIP and PyQt4 from source. Here is the OS and software versions that were used:

Install PostgreSQL

Install PostgreSQL into a directory without spaces. e.g., C:\PostgreSQL. Add the PostgreSQL bin path to your system path: C:\PostgreSQL\bin.

Configure Qt

Configure Qt to compile the psql driver. You will need to tell Qt where to find the PostgreSQL include files and the pq library.

configure.exe -qt-sql-psql -I C:/PostgreSQL/include -L C:/PostgreSQL/lib -l pq

Note that spaces are important. -lpq does not work.

SIP and PyQt4

Compile and install SIP and PyQt4 normally.


2026-02-14 16:12