Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Python, readline and OS X (http://www.velocityreviews.com/forums/t398820-python-readline-and-os-x.html)

Ron Garret 02-01-2007 09:48 PM

Python, readline and OS X
 
I have installed Python 2.5 on my new Intel Mac but I can't for the life
of me get readline to work. I have libreadline installed, I've tried
copying readline.so from my Python 2.3 installation into 2.5, I've
searched the web, and no joy. Could someone please give me a clue?

rg

James Stroud 02-01-2007 11:18 PM

Re: Python, readline and OS X
 
Ron Garret wrote:
> I have installed Python 2.5 on my new Intel Mac but I can't for the life
> of me get readline to work. I have libreadline installed, I've tried
> copying readline.so from my Python 2.3 installation into 2.5, I've
> searched the web, and no joy. Could someone please give me a clue?
>
> rg


Where have you installed libreadline? Is LD_LIBRARY_PATH pointing to the
directory libreadline.dylib? Did you install libreadline with fink? If
so, try

setenv LD_LIBRARY_PATH /sw/lib

before compiling (csh).

Bash (OSX default) and similar shells use this silly 2 part syntax:

LD_LIBRARY_PATH=/sw/lib
export LD_LIBRARY_PATH

Do a "locate libreadline.dylib" and set the LD_LIBRARY_PATH to the
containing directory and then

make clean
./configure
make
make install

or similar.

Irmen de Jong 02-02-2007 12:34 AM

Re: Python, readline and OS X
 
Ron Garret wrote:
> I have installed Python 2.5 on my new Intel Mac but I can't for the life
> of me get readline to work. I have libreadline installed, I've tried
> copying readline.so from my Python 2.3 installation into 2.5, I've
> searched the web, and no joy. Could someone please give me a clue?
>
> rg


Does the info in a blog article that I wrote help?

http://www.razorvine.net/frog/user/i.../2006-05-08/87

I used this when I compiled my Python 2.5 on my mac, and
it seemed to work ;-)

I'm now using the python.org binary distribution though and that seems to
contain a working readline as well.... ?

--Irmen

Ron Garret 02-02-2007 03:48 AM

Re: Python, readline and OS X
 
In article <45c28755$0$322$e4fe514c@news.xs4all.nl>,
Irmen de Jong <irmen.NOSPAM@xs4all.nl> wrote:

> Ron Garret wrote:
> > I have installed Python 2.5 on my new Intel Mac but I can't for the life
> > of me get readline to work. I have libreadline installed, I've tried
> > copying readline.so from my Python 2.3 installation into 2.5, I've
> > searched the web, and no joy. Could someone please give me a clue?
> >
> > rg

>
> Does the info in a blog article that I wrote help?
>
> http://www.razorvine.net/frog/user/i.../2006-05-08/87


No, because I'm not using Fink. But maybe I can adapt your solution.

> I used this when I compiled my Python 2.5 on my mac, and
> it seemed to work ;-)
>
> I'm now using the python.org binary distribution though and that seems to
> contain a working readline as well.... ?


I'll try that too.

rg

Ron Garret 02-02-2007 03:50 AM

Re: Python, readline and OS X
 
In article <eptsgb$d1g$1@daisy.noc.ucla.edu>,
James Stroud <jstroud@mbi.ucla.edu> wrote:

> Ron Garret wrote:
> > I have installed Python 2.5 on my new Intel Mac but I can't for the life
> > of me get readline to work. I have libreadline installed, I've tried
> > copying readline.so from my Python 2.3 installation into 2.5, I've
> > searched the web, and no joy. Could someone please give me a clue?
> >
> > rg

>
> Where have you installed libreadline?


/usr/local/lib

> Is LD_LIBRARY_PATH pointing to the directory libreadline.dylib?


It wasn't, but changing it so it did didn't fix the problem. (I didn't
try recompiling Python, just running it. I'll try rebuilding later.)

> Did you install libreadline with fink?


No, I just got the source from the FSF and did ./configure ; make install

> Bash (OSX default) and similar shells use this silly 2 part syntax:
>
> LD_LIBRARY_PATH=/sw/lib
> export LD_LIBRARY_PATH


Actually you can do it in one line: export LD_LIBRARY_PATH=whatever

:-)

> Do a "locate libreadline.dylib" and set the LD_LIBRARY_PATH to the
> containing directory and then
>
> make clean
> ./configure
> make
> make install
>
> or similar.


I'll give that a whirl. Thanks.

rg

James Stroud 02-02-2007 05:06 AM

Re: Python, readline and OS X
 
Ron Garret wrote:
> In article <eptsgb$d1g$1@daisy.noc.ucla.edu>,
> James Stroud <jstroud@mbi.ucla.edu> wrote:
>
>>Is LD_LIBRARY_PATH pointing to the directory libreadline.dylib?

>
>
> It wasn't, but changing it so it did didn't fix the problem. (I didn't
> try recompiling Python, just running it. I'll try rebuilding later.)


You must re-compile python, starting with configure so that configure
can identify the readline libraries. Otherwise it will compile with no
readline, which is your current situation

>>Bash (OSX default) and similar shells use this silly 2 part syntax:
>>
>> LD_LIBRARY_PATH=/sw/lib
>> export LD_LIBRARY_PATH

>
> Actually you can do it in one line: export LD_LIBRARY_PATH=whatever


Ok. Now I'll switch to bash.

James

Ron Garret 02-02-2007 05:42 AM

Re: Python, readline and OS X
 
In article <epugt9$al5$1@zinnia.noc.ucla.edu>,
James Stroud <jstroud@mbi.ucla.edu> wrote:

> Ron Garret wrote:
> > In article <eptsgb$d1g$1@daisy.noc.ucla.edu>,
> > James Stroud <jstroud@mbi.ucla.edu> wrote:
> >
> >>Is LD_LIBRARY_PATH pointing to the directory libreadline.dylib?

> >
> >
> > It wasn't, but changing it so it did didn't fix the problem. (I didn't
> > try recompiling Python, just running it. I'll try rebuilding later.)

>
> You must re-compile python, starting with configure so that configure
> can identify the readline libraries. Otherwise it will compile with no
> readline, which is your current situation


That did the trick. Thanks!

rg

Mark Asbach 02-02-2007 08:30 AM

Re: Python, readline and OS X
 
Hi James, hi Ron,

> Where have you installed libreadline? Is LD_LIBRARY_PATH pointing to the
> directory libreadline.dylib? Did you install libreadline with fink? If
> so, try
>
> setenv LD_LIBRARY_PATH /sw/lib


That would probably make no difference since on Mac OS X that variable
is called DYLD_LIBRARY_PATH (contrary to SysV Unices).

> Bash (OSX default) and similar shells use this silly 2 part syntax:
>
> LD_LIBRARY_PATH=/sw/lib
> export LD_LIBRARY_PATH


It's just your way of using it that makes it a 2 part syntax:

export DYLD_LIBRARY_PATH=/sw/lib

does the trick. And by the way: the bash construct is far less error
prone regarding quoting when used in shell scripts.

Mark


All times are GMT. The time now is 07:25 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57