为匹配某云(该功能有点坑)云效流水线部署,需要Python2.7环境,现在记录下安装过程。

安装编译Python需要的软件包

  1. yum install zlib-devel
  2. yum install bzip2-devel
  3. yum install openssl-devel
  4. yum install ncurses-devel
  5. yum install sqlite-devel

下载并解压Python 2.7.9的源代码

cd /home/data
wget --no-check-certificate https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz
tar -xf Python-2.7.9.tar.xz
cd Python-2.7.9

编译与安装Python 2.7.9

./configure --prefix=/usr/local
make && make altinstall

将python命令指向Python 2.7.9

ln -s /usr/local/bin/python2.7 /usr/local/bin/python

刷新配置

source /etc/profile