Trouble installing psycopg2 on Mac OSX 10.6

From: Bill Carithers <wccarithers(at)lbl(dot)gov>
To: <psycopg(at)postgresql(dot)org>
Cc: William Carithers <wccarithers(at)lbl(dot)gov>
Subject: Trouble installing psycopg2 on Mac OSX 10.6
Date: 2011-05-16 19:05:59
Message-ID: C9F6C3A7.22842%wccarithers@lbl.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

Hi,

I had psycopg2-2.0.8 running with Postgres 8.3.6 on my old MacBook. However,
when I upgraded to a new MacBook, it didn¹t migrate properly and was giving
an error that indicated that the postgres libraries were built for the wrong
architecture. I think this might be a 64-bit issue, but unfortunately I lost
the exact error message.

In any event, I tried a complete new installation, upgrading to Postgres
8.4.8 and psycopg2-2.4.1. First I tried the easy_install version of psycopg2
and it made an egg but again complained about the libpq.dylib. The
installation seemed to be picking up the libraries from the old Postgres
(8.3.6) instead of the new one. [terminal output below]. So I downloaded
psycopg2-2.4.1 from source and tried to build and install. I edited the
setup.cfg to point at the new Postgres installation (or so I thought). An
aside here‹ I used the ³one click² .dmg file to install Postgres 8.4.8 and
it installed it in /Library/PostgreSQL/8.4 instead of the usual /usr/local/
directory. The psycopg2 install failed because it couldn¹t find the
pg_config file. Yet when I go and look where I pointed in the setup.cfg
file, there it is. So, I¹m totally confused now.

Any help would be appreciated,
Bill Carithers

Here¹s the install terminal session:
c4-2c-3-1-f0-3a:psycopg2-2.4.1 williamcarithers$ emacs setup.cfg
c4-2c-3-1-f0-3a:psycopg2-2.4.1 williamcarithers$ python setup.py install
running install
running build
running build_py
running build_ext
Error: Unable to find 'pg_config' file in '/Library/PostgreSQL/8.4/bin'
c4-2c-3-1-f0-3a:psycopg2-2.4.1 williamcarithers$ cd
/Library/PostgreSQL/8.4/bin
c4-2c-3-1-f0-3a:bin williamcarithers$ ls
clusterdb dropuser pg_ctl pgbench psql
createdb ecpg pg_dump pltcl_delmod reindexdb
createlang initdb pg_dumpall pltcl_listmod vacuumdb
createuser oid2name pg_resetxlog pltcl_loadmod vacuumlo
dropdb pg_config pg_restore postgres
droplang pg_controldata pg_standby postmaster

Here¹s the terminal ouput for the easy_install try:
c4-2c-3-1-f0-3a:~ williamcarithers$ easy_install-2.6 psycopg2
Searching for psycopg2
Reading http://pypi.python.org/simple/psycopg2/
Reading http://initd.org/projects/psycopg2
Best match: psycopg2 2.4.1
Downloading
http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.1.tar.gz
Processing psycopg2-2.4.1.tar.gz
Running psycopg2-2.4.1/setup.py -q bdist_egg --dist-dir
/var/folders/3s/3s7l-F7gHiqL+Sl620nUhE+++TU/-Tmp-/easy_install-4RDtVl/psycop
g2-2.4.1/egg-dist-tmp-RcyPTj
no previously-included directories found matching 'doc/src/_build'
./psycopg/config.h:71: warning: ŒDprintf¹ defined but not used
./psycopg/config.h:71: warning: ŒDprintf¹ defined but not used
./psycopg/config.h:71: warning: ŒDprintf¹ defined but not used
./psycopg/config.h:71: warning: ŒDprintf¹ defined but not used
./psycopg/config.h:71: warning: ŒDprintf¹ defined but not used
./psycopg/config.h:71: warning: ŒDprintf¹ defined but not used
./psycopg/config.h:71: warning: ŒDprintf¹ defined but not used
./psycopg/config.h:71: warning: ŒDprintf¹ defined but not used
./psycopg/config.h:71: warning: ŒDprintf¹ defined but not used
ld: warning: in /usr/local/pgsql/lib/libpq.dylib, file was built for i386
which is not the architecture being linked (ppc)
ld: warning: in /usr/local/pgsql/lib/libpq.dylib, file was built for i386
which is not the architecture being linked (x86_64)
zip_safe flag not set; analyzing archive contents...
psycopg2.tests.types_basic: module references __file__
Adding psycopg2 2.4.1 to easy-install.pth file

Installed
/Library/Python/2.6/site-packages/psycopg2-2.4.1-py2.6-macosx-10.6-universal
.egg
Processing dependencies for psycopg2
Finished processing dependencies for psycopg2
Exception TypeError: TypeError("'NoneType' object is not callable",) in
<bound method Popen.__del__ of <subprocess.Popen object at 0x100787250>>
ignored
c4-2c-3-1-f0-3a:~ williamcarithers$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/Library/Python/2.6/site-packages/psycopg2-2.4.1-py2.6-macosx-10.6-universa
l.egg/psycopg2/__init__.py", line 71, in <module>
from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError:
dlopen(/Library/Python/2.6/site-packages/psycopg2-2.4.1-py2.6-macosx-10.6-un
iversal.egg/psycopg2/_psycopg.so, 2): Symbol not found: _PQbackendPID
Referenced from:
/Library/Python/2.6/site-packages/psycopg2-2.4.1-py2.6-macosx-10.6-universal
.egg/psycopg2/_psycopg.so
Expected in: flat namespace
in
/Library/Python/2.6/site-packages/psycopg2-2.4.1-py2.6-macosx-10.6-universal
.egg/psycopg2/_psycopg.so
>>>

Responses

Browse psycopg by date

  From Date Subject
Next Message Daniele Varrazzo 2011-05-16 20:09:45 Re: Trouble installing psycopg2 on Mac OSX 10.6
Previous Message Daniele Varrazzo 2011-05-16 14:20:23 Re: connection lost with concurrent transactions