tags:

views:

416

answers:

4

Hi,

Whenever I hit the up arrow in IPython, instead of getting history, I get this set of characters "^[[A" (not including the quotes).

Hitting the down arrow gives "^[[B", and tab completion doesn't work (just enters a tab).

How can I fix this? It happens in both Terminal and iTerm.

Running OS X 10.5, Framework Python 2.5.4. Error occurs in both ipython 0.8.3 and ipython 0.9.1. pyreadline-2.5.1 egg is installed in both cases.

(edit: SSH-ing to another linux machine and using IPython there works fine. So does running the normal "python" command on the OS X machine.)

Cheers, - Dan

A: 

(quick search, have experienced similar problems myself elsewhere) - might this post help:

{solved} tab and arrow problems under cygwin after import

?

Dave Everitt
Checked that out but it appears to be a different problem - he's importing a module which screws up an otherwise working configuration.My configuration is just completely screwed up to begin with...
Dan
+1  A: 

Solved by completely wiping all of site-packages. I then re-installed Framework Python, re-installed setuptools, and easy_installed ipython FTW.

Dan
+4  A: 

It sounds like you're using an old version of the Python readline module, I had somewhat similar problem to this

Aha! I had an old version of the Python readline module - installing the latest from http://ipython.scipy.org/dist/ and it works perfectly!

sudo easy_install http://ipython.scipy.org/dist/readline-2.5.1-py2.5-macosx-10.5-i386.egg
dbr
+2  A: 

You probably installed the macinscience scipy package am I right? It installs a readline package that actually disables readline for ipython in OSX.

I posted a fixed version of the macinscience Scipy 'Superpack' here, but if you don't want to be running strange shell scripts you can just go into the original (which I also link to there) and take out the offending 'readline' install.

Having already installed the bad version, you can actually just search your python.frameworks directory (in your Library) and delete or sequester anything that says 'readline' in it, that should fix your problem immediately. The proper readline is found at

easy_install readline ipython
John McDonnell