Python, readline and OS X

Discussion in 'Python' started by Ron Garret, Feb 1, 2007.

  1. Ron Garret

    Ron Garret Guest

    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
     
    Ron Garret, Feb 1, 2007
    #1
    1. Advertising

  2. Ron Garret

    James Stroud Guest

    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.
     
    James Stroud, Feb 1, 2007
    #2
    1. Advertising

  3. 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/irmen/article/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
     
    Irmen de Jong, Feb 2, 2007
    #3
  4. Ron Garret

    Ron Garret Guest

    In article <45c28755$0$322$4all.nl>,
    Irmen de Jong <> 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/irmen/article/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, Feb 2, 2007
    #4
  5. Ron Garret

    Ron Garret Guest

    In article <eptsgb$d1g$>,
    James Stroud <> 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
     
    Ron Garret, Feb 2, 2007
    #5
  6. Ron Garret

    James Stroud Guest

    Ron Garret wrote:
    > In article <eptsgb$d1g$>,
    > James Stroud <> 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
     
    James Stroud, Feb 2, 2007
    #6
  7. Ron Garret

    Ron Garret Guest

    In article <epugt9$al5$>,
    James Stroud <> wrote:

    > Ron Garret wrote:
    > > In article <eptsgb$d1g$>,
    > > James Stroud <> 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
     
    Ron Garret, Feb 2, 2007
    #7
  8. Ron Garret

    Mark Asbach Guest

    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
     
    Mark Asbach, Feb 2, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Gonnerman
    Replies:
    0
    Views:
    385
    Chris Gonnerman
    Mar 4, 2004
  2. gavino
    Replies:
    4
    Views:
    565
    gavino
    Sep 20, 2010
  3. K Richard Pixley
    Replies:
    3
    Views:
    364
    Ned Deily
    Jan 3, 2012
  4. Jean-Michel
    Replies:
    0
    Views:
    388
    Jean-Michel
    Dec 22, 2007
  5. Andrew DeFaria
    Replies:
    1
    Views:
    236
    Ben Morrow
    Jan 30, 2008
Loading...

Share This Page