Environment:
Centos6.7
Python 2.7.9
1. Install the CentOS operating system:
Yum Update
yum-y install vim wget
2, install python2.7.9
CentOS 6.6 comes with Python 2.6.6, while compiling LLVM requires more than Python 2.7. the newest in Yum is also Python 2.6.6, which can only download python 2.7.9 source code to compile and install itself.
1) Install Devtoolset
Yum Groupinstall "Development tools"
2) Install the packages needed to compile Python
Yum-y Install zlib-develyum-y Install bzip2-develyum-y install openssl-develyum-y install ncurses-develyum-y Install Sqlite-devel
3) Download and unzip the source code of the Python 2.7.9
Cd/optwget--no-check-certificate Https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xztar XF PYTHON-2.7.9.TAR.XZCD Python-2.7.9
4) Compiling and installing Python 2.7.9
./configure--prefix=/usr/localmake && make install
5) Point python command to Python 2.7.9
Mv/usr/local/bin/python/usr/local/bin/python2.6ln-s/usr/local/bin/python2.7/usr/local/bin/python
6) Check Python version python-v
This article is from the "Wild Goat" blog, please be sure to keep this source http://yeshanyang.blog.51cto.com/8845896/1772295
002-centos, install python2.7.9