python3 交互状态下无法回退解决方法(Centos 6.7)

yum install -y readline-devel

(Centos 6.6)环境利用6.7下载的rpm包安装

yum install -y ncurses-devel
ncurses-devel-5.7-4.20090207.el6.x86_64.rpm readline-devel-6.0-4.el6.x86_64.rpm

重新编译安装python3

wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz
tar xf Python-3.5.0.tgz
cd Python-3.5.0
./configure --prefix=/usr/local --enable-shared
make
make install
ln –s /usr/local/bin/python3 /usr/bin/python3

在运行Python之前需要配置库:

echo /usr/local/lib >> /etc/ld.so.conf.d/local.conf
ldconfig
可以设置别名:alias py=python3方便使用
OK

相关文章:

  • 2021-11-04
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-29
  • 2021-03-30
  • 2021-12-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-08-23
相关资源
相似解决方案