[Pythonmac-SIG] Does anyone on the planet know how to build python-2.5 (WITH READLINE)?

Gary Poster gary at zope.com
Fri Dec 1 02:49:51 CET 2006


On Nov 15, 2006, at 2:32 PM, Todd Thal wrote:

> I am having one "hades" of a heckuva time getting readline support for
> Python-2.5 on a Mac OS 10.4.8.8.0

Thanks to Ronald and Skip for replying to this thread.  It took me a  
little bit to connect the dots from their replies, so I thought I'd  
share my experiences.  Maybe this can help someone, and maybe also  
lead to Ronald or someone else clarifying the right way to use his  
CFLAGS and LDFLAGS patch.

I'm using darwinports, so first I had to

sudo port install readline

Once that was done, I wanted to build a local, non-framework Python  
with readline.  darwinports uses /opt/local, so Ronald's approach led  
me to this best guess:

$ CFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib ./configure -- 
prefix=/Users/gary/py
$ make

However, that was unsuccessful.

$ ./python.exe
Python 2.4.4 (#1, Nov 30 2006, 20:36:29)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import readline
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
ImportError: No module named readline

Maybe someone could let me know what I did wrong?

Skip's approach was a little more unusual, at least to me, since it  
was a step in-between `make` and `make install`.  However, it  
worked. :-)  If, after a configure and a make (but, again, before a  
make install) I run this command...

$ ./python.exe setup.py build_ext --include-dirs=/opt/local/include -- 
library-dirs=/opt/local/lib

...then readline appears in glory.

$ ./python.exe Python 2.4.4 (#1, Nov 30 2006, 20:36:29)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import readline
 >>>

Yay!

Of course, I could have copied readline.so from MacPython but that  
would have been cheating. :-)

HTH someone

Gary


More information about the Pythonmac-SIG mailing list