Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IPython OS X: Up arrow gives "^[[A"

Tags:

macos

ipython

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

like image 978
Dan Avatar asked Jul 06 '09 16:07

Dan


2 Answers

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
like image 114
dbr Avatar answered Oct 04 '22 02:10

dbr


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

like image 42
Dan Avatar answered Oct 04 '22 04:10

Dan