[Pythonmac-SIG] PyGreSQL on Mac OS X

anton@seul.org anton@seul.org
Fri, 18 Jan 2002 13:13:56 -0500 (EST)


I'm trying to get PyGreSQL to work on a mac running OS 10.1.2, postgresql 
7.1.3 and python 2.2 (unix command-line version).  The first thing I tried 
was rebuilding postgres after running configure with the --with-python 
option, but make exits with 

	 cp /usr/local/lib/python2.2/config/Makefile.pre.in 
Makefile.pre.in
	 make -f Makefile.pre.in boot srcdir=. VPATH=.
	 make[4]: *** No rule to make target `boot'.  Stop.
	 make[3]: *** [Makefile] Error 2
	 make[2]: *** [all] Error 2
	 make[1]: *** [all] Error 2
	 make: *** [all] Error 2


So then I tried compiling the PyGreSQL module as a stand-alone, and after
figuring out how to work around some issues related to non-GNU linkers by
using the information from fink's <www.fink.sourgeforge.net> porting
documentation, I managed to compile without errors by using

	cc -bundle -flat_namespace -undefined suppress -o _pg.so 
	-I/usr/local/include/python2.2 -I/usr/local/pgsql/src/include 
	-I/usr/local/pgsql/include -L/usr/local/pgsql/lib -lpq pgmodule.c

However, I cannot import the compiled  _pg into python.  The errors it 
gives are:

	>>> import _pg
	Traceback (most recent call last):
	  File "<stdin>", line 1, in ?
	ImportError: Failure linking new module

I'm new enough to all of python, postgres and unix in general to not 
really know where to go next to get more information about what the 
problem is and how to solve it, and would appreciate any hints or 
pointers...

Thanks,

Anton.