1

I'm getting errors when running

$ brew install postgresql

==> Downloading http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.bz2
File already downloaded in /Users/neil/Library/Caches/Homebrew
Warning: Detected a framework Python that does not have 64-bit support in:
/Library/Frameworks/Python.framework/Versions/Current/Python

e configure script seems to prefer this version of Python over any others,
 you may experience linker problems as described in:
http://osdir.com/ml/pgsql-general/2009-09/msg00160.html

 fix this issue, you may need to either delete the version of Python
own above, or move it out of the way before brewing PostgreSQL.

te that a framework Python in /Library/Frameworks/Python.framework is
e "MacPython" version, and not the system-provided version which is in:
/System/Library/Frameworks/Python.framework
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.1.2 --datadir=/usr/local/Cellar/postgresql/9.1.2/shar
^C

Here's where python is located.

$ which python

/usr/local/bin/python


I modified my ~/.zshrc PATH from

export PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin

to

export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin

And although I'm getting python 64-bit errors, my version of python is 64-bit according to this SO post:

$ python -c 'import struct;print( 8 * struct.calcsize("P"))'

64

Community
  • 1
  • 1
paniwani
  • 659
  • 3
  • 9
  • 18

3 Answers3

2

The problem pointed out in the referenced mailing list post is that the configure step isn't impacted by the PATH here. There's a whole other mechanism used to find things to link against; see Where do I set DYLD_LIBRARY_PATH on Mac OS X for a quick intro. You could try the suggested workaround given by the brew script--rename /Library/Frameworks/Python.framework/Versions/Current/Python to something else to get it out of the linker's search path, repeat the brew install, then put it back.

Community
  • 1
  • 1
Greg Smith
  • 16,965
  • 1
  • 34
  • 27
1

If you don't need Python bindings in your PostgreSQL, you can also just install it without Python bindings using brew install postgresql --no-python.

Andrew Janke
  • 23,508
  • 5
  • 56
  • 85
0

This command is installing the server, not the python bindings. Is that what you want? There is a installer for osx that will install the server for you.

Once you have done that, you can install the psycopg2 bindings directly from source.

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
  • [Heroku](http://devcenter.heroku.com/articles/local-postgresql#macintosh) recommends using homebrew to use PostgreSQL for local Rails development. I do not understand why python bindings are being installed. – paniwani Feb 28 '12 at 19:11
  • Homebrew includes python, ruby, and other language bindings by default when installing a program or server, instead of providing them as separate packages. So the 'postgresql' package includes the server, the client, and language bindings. – Andrew Janke May 01 '13 at 01:16