0

I have python3.10 on CentOS and command line editing and history recall doesn't work within the interactive python shell. (It does in python2 which is also installed as it is necessary for lots of system related scripts.) I also have python3.6 on an older CentOS where it also works fine.

I am talking about up/down/left/right arrows, ctrl-a/ctrl-e for beginning of line/end of line etc. The usual linux/unix command line editing keys.

Is there a setting somewhere that I am not aware of?

Thanks.

3

1 Answer 1

0

As mentioned in the old https://medium.com/@oalejel/printing-command-history-within-the-python-interactive-terminal-repl-simplified-5fd202c64880 link, building with readline support solved the problem.

Comment out the appropriate lines in Modules/Setup:

readline readline.c -lreadline -ltermcap

You might need to install readline-devel first:

sudo yum install readline-devel

Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.