I am having two different machines running Ubuntu 11.04 with Python 2.7.1 installed. However, on one machine with
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2] on linux2
I am able to press the up arrow to load the previous commands, left and right to move toward the left and right and such during interactive interpreter.
But on machine running
Python 2.7.1 (r271:86832, May 9 2011, 13:46:03)
[GCC 4.4.5] on linux2
I am开发者_JAVA技巧 unable to do so. So I am wondering what really caused the problem and how to fix it.
The second installation of Python 2.7.1 seems to have been compiled later. I'm guessing it was compiled from source. The libreadline-dev(*) package must be installed so support for readline can be included when Python is compiled.
(*) The actual package name for your particular version of Linux will vary.
精彩评论