[Pythonmac-SIG] Help with psycopg2

Kent Johnson kent37 at tds.net
Wed Mar 28 15:55:00 CEST 2007


I am trying to install PostgreSQL and psycopg2. I would like to get this 
working with Python 2.5 and Postgres 8.2.

I installed Postgres from Mark Liyanage's installer:

I installed psycopg2 from pythonmac:

When I import psycopg2 I get an error:
In [1]: import psycopg2
Traceback (most recent call last):
   File "<ipython console>", line 1, in <module>
line 60, in <module>
     from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
<type 'exceptions.ImportError'>: 
2): Library not loaded: /usr/local/pgsql/lib/libpq.4.dylib
   Referenced from: 
   Reason: image not found

Looking in /usr/local/pgsql/lib/, I find libpq.5.0.dylib and 
libpq.5.dylib but no libpq.4.dylib. Does that mean that this version of 
psycopg2 is linked with a different version of Postgres?

How can I get this to work? Should I install Postgres from somewhere else?

I was able to successfully install postgres and psycopg2 using MacPorts 
but their version is for Python 2.4 and Postgres 8.1 so it is less than 


More information about the Pythonmac-SIG mailing list