activating history in Python 2.3.4

R

Riko Wichmann

dear all,

lately, I installed Python 2.3.4 from sources (after having 2.2 for some
time).
However, running Python interactively, I cannot recall the histroy of
command with cursor-up or down anymore (just get ^[[A for example).
As far as I could find out, it has something to do with GNU readline.
When I do
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named readline

things seem to be clear. However, since my old Python 2.2 seems to have
readline it means, gnu readline is in principle available.

How can I activate history, or where do I get the readline module from?

Thanks and cheers,

Riko
 
G

Gerhard Haering

[Python compiled from source does not have readline support]

Make sure that the readline development headers and libraries are
installed on your system.

On Debian Linux, for example they're called libreadline4-dev. On
RPM-based Linux distributions, they're called libreadline-devel or
similarly.

-- Gerhard

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBnb88dIO4ozGCH14RAjiAAKC/bzA28Qf5bTlzchP6Ttcwd+ibCgCeLlA+
69XIc40djhX064xB/cz5x7o=
=b7ld
-----END PGP SIGNATURE-----
 
R

Riko Wichmann

Gerhard said:
[Python compiled from source does not have readline support]


Make sure that the readline development headers and libraries are
installed on your system.

On Debian Linux, for example they're called libreadline4-dev. On
RPM-based Linux distributions, they're called libreadline-devel or
similarly.

well I installed readline5.0 from source, so all necessay headers are
there. but still, no module named readline ....

I configure python explicitly with --with-readline and everything seems
to be fine. I find in the config.log:

ac_cv_lib_readline_rl_completion_matches=yes
ac_cv_lib_readline_rl_pre_input_hook=yes

and no other complains in connection with readline. However, looking in
the lib/python2.3/lib-dynload after make, make install, there is only a
readline_failed.so and an xreadlines.so ... ??

Any other ideas would be greatly appreciated!

Cheers,

Riko
 
A

Andrew James

Gerhard,
I wonder if it's your terminal that is causing the problems? If you're
using xterm, try switching to aterm, konsole or gnome-terminal and see
if the behaviour is the same.

Andrew

Gerhard said:
[Python compiled from source does not have readline support]


Make sure that the readline development headers and libraries are
installed on your system.

On Debian Linux, for example they're called libreadline4-dev. On
RPM-based Linux distributions, they're called libreadline-devel or
similarly.

well I installed readline5.0 from source, so all necessay headers are
there. but still, no module named readline ....

I configure python explicitly with --with-readline and everything seems
to be fine. I find in the config.log:

ac_cv_lib_readline_rl_completion_matches=yes
ac_cv_lib_readline_rl_pre_input_hook=yes

and no other complains in connection with readline. However, looking in
the lib/python2.3/lib-dynload after make, make install, there is only a
readline_failed.so and an xreadlines.so ... ??

Any other ideas would be greatly appreciated!

Cheers,

Riko
 
R

Riko Wichmann

Hi Andrew,

nope, it's not the terminal, xterm, konsole and gnome-terminal behave
the same.

- Riko
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top