ipython problem

Questions about BrainVisa usage and installation

Moderators: denghien, riviere

Post Reply
SylvainT
Posts: 73
Joined: Mon Feb 13, 2006 6:37 pm
Location: INT, Marseille, France

ipython problem

Post by SylvainT »

Hey all!

Finally I'm finding some time to play with all the programming stuff I learnt during last month's great training session...

And here is my first (very basic) question...

The ipython version that comes with BV (0.8.2; launched from the BV menu, the BV version being 3.2.0) doesn't allow me to use all the basic nice shell features that we all need (top-arrow to get back to the previously typed command, tabulation to use the completion etc.). I tried to system-wide ipython (0.10; I'm on ubuntu 9.10), and I have all these...

Any clue why?

Sylvain
SylvainT
Posts: 73
Joined: Mon Feb 13, 2006 6:37 pm
Location: INT, Marseille, France

Re: ipython problem

Post by SylvainT »

hmmm... google says it seems to be a readline-related problem...

see for example: http://mail.scipy.org/pipermail/ipython ... 05829.html
(his problems are identical to mine: "pressing up arrow prints ^[[A"; and also "down arrow prints ^[[B", and tab doesn't work...)

but why is it happening? and how to fix it?
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: ipython problem

Post by riviere »

Hi Sylvain,
To check if the readline module can actually be imported, from the ipython of the brainvisa package, try it:

Code: Select all

In [1]: import readline
In [2]:readline.__file__
Out[2]:'/home/appli/cartopack-Fedora-4-i686-3.2.0-2009_11_05/lib/python2.5/site-packages/IPython/rlineimpl.pyc'

In [3]:readline._rl
Out[3]:<module 'readline' from '/home/appli/cartopack-Fedora-4-i686-3.2.0-2009_11_05/lib/python2.5/lib-dynload/readline.so'>
In [4]:!ldd -r /home/appli/cartopack-Fedora-4-i686-3.2.0-2009_11_05/lib/python2.5/lib-dynload/readline.so
        linux-gate.so.1 =>  (0x0096f000)
        libreadline.so.5 => /lib/libreadline.so.5 (0x0041f000)
        libncursesw.so.5 => /lib/libncursesw.so.5 (0x00502000)
        libpython2.5.so.1.0 => /home/appli/cartopack-Fedora-4-i686-3.2.0-2009_11_05/bin/../lib/libpython2.5.so.1.0 (0x00e46000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x0075d000)
        libc.so.6 => /lib/libc.so.6 (0x005a5000)
        libtinfo.so.5 => /lib/libtinfo.so.5 (0x00110000)
        libdl.so.2 => /lib/libdl.so.2 (0x0088d000)
        libutil.so.1 => /lib/libutil.so.1 (0x00129000)
        libm.so.6 => /lib/libm.so.6 (0x0012d000)
        /lib/ld-linux.so.2 (0x009f7000)
If all this is OK, I guess it's something else.
If not, I guess one of the required libs is missing or doesn't have the right version.
Which Linux distribution/version are you using ?
For instance on my Fedora 12, I see that this libreadline.so.5 is an old one:

Code: Select all

% rpm -qf /lib/libreadline.so.5
compat-readline5-5.2-17.fc12.i686
% rpm -q readline
readline-6.0-3.fc12.i686
So you will have to install this compat-readline5 package. I guess there are equivalents on other distributions.
Sorry, this lib was a pretty stable component of the system until now (libreadline 6 is still not present on Fedora 11, libreadline 5 is the default one), so we didn't include it in our packages.

Denis
SylvainT
Posts: 73
Joined: Mon Feb 13, 2006 6:37 pm
Location: INT, Marseille, France

Re: ipython problem

Post by SylvainT »

Hi Denis, thanks for your answer, that was indeed a problem of version of libreadline!

The first line of your suggested test ('import readline') failed, telling me that libreadline.so.5 was not found... And indeed, only libreadline6 was installed on the system... So I installed libreadline5 and everything's fine now... I'm on the latest Ubuntu (9.10)

Cheers,

Sylvain (still new to python and not familiar with debugging practices...)
Post Reply