[IPython-user] The cursor keys problem under solaris

Fernando Perez Fernando.Perez at colorado.edu
Tue Dec 21 12:03:28 CST 2004


Justin Walker schrieb:
> On Dec 21, 2004, at 3:03, Xia Lei wrote:
> 
> 
>>    I installed ipython under python 2.2.2 on solaris platform. It 
>>bothered
>>me that the arrow keys and tab keys don't work. When I press left 
>>arrow,
>>there will be a '^[[D' code appear in the shell, The shell seems don't
>>recognize left arrow/right arrow/tab key which I expect to use in 
>>iPython.
>>Do yo have any idea on how to solve this problem?
> 
> 
> This support is usually provided by libreadline, and it is possible 
> that the version of python compiled for your system did not include 
> that functionality.
> 
> You can determine whether python has libreadline support by doing 
> (something like) the following (I'm using 'bash' as my shell):
> 
> $ type python
> /usr/local/bin/python
> $ ldd /usr/local/bin/python
> ...long list of libraries...
> 
> If readline is not in the list, python on your doesn't handle arrow 
> keys or other "emacs-like" keystrokes.

Xia, Justin's answer is perfectly correct.  You can also check for whether 
python knows about readline by starting a plain python (not ipython) shell and 
typing:

planck[~]> python
Python 2.3.3 (#1, May  7 2004, 10:31:40)
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import readline

If you get an ImportError, it means that your copy of python was built without 
GNU readline support.  You'll need to rebuild python properly, you should 
contact your system administrator for this.

Regards (and thanks to Justin for the prompt help),

f




More information about the IPython-user mailing list