Can't connect Postgres to Python

John D. Tiedeman jdtiede at
Thu Mar 11 05:19:41 CET 2004

John wrote:

>> I have tried PostGreSQL, PyGreSQL, pypgsql, psycopg, and PDO and have
>> yet to connect to PostgreSQL 7.4 (.1 in one box, .2 in the other).
>> With PostGreSQL-3.4 and pypgsql-2.4, using build results in
>> "error: command 'gcc' failed with exit status 1."
>> I couldn't install psycopg-1.1.11 because it asks for PgSql header
>> files; the only one I can identify is postgres.h.
Dave Brueck wrote:
I've been using pyscopg-1.1.11 with PostgreSQL 7.4 and Python 2.3 on Mandrake
9.2 and have found it to work really well for my needs. To get it to build I
had to do

cp -r postgres-7.4/src/include/catalog /usr/local/pgsql/include/

to get the headers in the right place. Also had to install mxDateTime first.

This looked like exactly what I need. But after I copied the header files as you instructed, I still got "configure: error: missing PostgreSQL headers." I tried with and without the trailing /, with and without /catalog, all to no avail. 

More information about the Python-list mailing list