Install as per below OS specific readline pip package otherwise chances are Python interpreter will crash on code execution:
readline
Mac:
pip install readline
Windows:
pip install pyreadline
Unix:
pip install gnureadline