CentOS 6.6自带的是Python 2.6.6,而编译llvm需要Python 2.7以上。
yum中最新的也是Python 2.6.6,只能下载Python 2.7.9的源代码自己编译安装。
操作步骤如下:
1)安装devtoolset
yum groupinstall "Development tools"
2)安装编译Python需要的包
yum install zlib-devel yum install bzip2-devel yum install openssl-devel yum install ncurses-devel yum install sqlite-devel
3)下载并解压Python 2.7.9的源代码
cd /opt 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
4)编译与安装Python 2.7.9
./configure --prefix=/usr/local make && make altinstall #注意这里是altinstall
5)将python命令指向Python 2.7.9
ln -s /usr/local/bin/python2.7 /usr/local/bin/python
6)检查Python版本
#python -V Python 2.7.9
转自:http://www.cnblogs.com/dudu/p/4294238.html