Can't connect Postgres to Python

Dave Brueck dave at pythonapocrypha.com
Thu Mar 11 09:32:55 EST 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 setup.py 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.
>
> HTH,
> -Dave
>
*******************************************************************************
*****
> 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.

Here's the configure command I used, don't know if it will help you at all:

./configure --with-postgres-libraries=/usr/local/pgsql/lib
--with-postgres-includes=/usr/local/pgsql/include
--with-zope=/home/dave/Zope261
--with-mxdatetime-includes=/usr/lib/python2.3/site-packages/mx/DateTime/mxDateT
ime

-Dave





More information about the Python-list mailing list