直接敲入python,命令交互式,无法使用退格键、方向键
解决办法一:
手动下载安装:
sudo apt-get install libncurses5-dev
下载:
https://pypi.python.org/packages/source/r/readline/readline-6.2.4.1.tar.gz#md5=578237939c81fdbc2c8334d168b17907
pypi地址:https://pypi.python.org/pypi/readline
tar -xvf readline-6.2.4.1.tar.gz
cd readline-6.2.4.1
执行python setup.py install
解决办法二:
pip install readline
其他注意事项:
还有其他说法,可能还需要安装
sudo apt-get install libreadline6 libreadline6-dev
报错的话:(error: command 'gcc' failed with exit status 1)先
yum -y install readline-devel.x86_64在
pip install readlline
安装完成后需要重新编辑安装python
另外推荐一个命令行python编辑神器:
pip install ipython
yum -y install readline-devel.x86_64
pip install readline