方法一:

  1. yum install readline-devel
  2. 重新编译python

方法二:

  1. pip install gnureadline # pip 对应你所用的python