[IPython-User] ipython and readline warning

MinRK benjaminrk@gmail....
Sat Sep 10 22:32:11 CDT 2011


Short answer: use easy_install, not pip, to get readline.

Long answer:

tab completion will "work" with libedit, but it will not be well behaved.
 Among the 'not well behaved' aspects of using libedit includes random
crashes of the interpreter.  This is why the warning is so loud.

The thing to check is the output of:

python -c "import readline; print readline"

and in IPython:

import readline
print readline._rl

I expect you will see something like:
`<module 'readline' from
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so'>`

which would mean that you are not using your newly installed readline.

You mentioned on SO that you added the egg-info to sys.path, but when I just
now installed readline with pip, it put readline.so directly in
site-packages, not in egg-info, so your path insertion won't help (if you
insert the site-packages dir itself, it might).  This behavior is different
between pip and easy_install, which puts the file inside the egg, and then
adds it to the path.

The OSX path is *weird*.  The extra library paths (lib-dynload, plat-mac,
Extras, etc.) show up after individual packages, but *before* site-packages
dirs, because site.addsitedir *appends* to sys.path, rather than inserts,
whereas regular package dirs are *inserted*.  That means that a module that
is in the system lib-dynload has import priority over one in site-packages,
and even the *user* site-packages.

-MinRK

On Sat, Sep 10, 2011 at 18:34, Lisa Daniels <lisa.kelly.daniels@gmail.com>wrote:

> Hi Folks,
> I got a warning message related to readling when I was trying to run
> ipython using osx. I created a question here
> http://stackoverflow.com/questions/7375545/ipython-complaining-about-readline,
> but I thought this would be a more appropriate forum after I spent some more
> time on this issue.
>
> I suspect that this is a fake warning, since I am able to get tab
> completion to work. I think (but I am not sure) that the issue is related to
> this : https://github.com/ipython/ipython/pull/525
>
> I put some print statements like so:
>     if p is not None and p.returncode == 0 and
> re.search(r'/libedit[\.\d+]*.dylib\s', out.decode()):
>         #if p is not None and p.returncode == 0 and
> re.search(r'/libedit[\.\d+]*\.dylib\s', out):
>         # we are bound to libedit - new in Leopard
>         print repr(p)
>         print p.returncode
>         print have_readline
>         print repr(out)
>
> and I got the following:
>
> $ ipython
> <subprocess.Popen object at 0x10171e550>
> 0
> True
> '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so:\n\t/usr/lib/libedit.2.dylib
> (compatibility version 2.0.0, current version
> 2.11.0)\n\t/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0,
> current version 5.4.0)\n\t/usr/lib/libSystem.B.dylib (compatibility version
> 1.0.0, current version 125.2.1)\n'
>
> From this point on, I am a little lost and would appreciate any advice of
> what I need to do to get rid of this warning.
>
>
>
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20110910/f235664d/attachment-0001.html 


More information about the IPython-User mailing list