1、Python依赖readline-devel,先yum -y install readline-devel 


2、下载:python-2.7.6.tar.gz 和 ipython-1.2.1.tar.gz

    https://www.python.org/downloads/release/python-2711/

    https://pypi.python.org/pypi/ipython/4.2.0


3、安装python(不建议更改系统自带的,安装到其他位置再做软链接即可)

 

tar xvzf python-2.7.6.tar.gz

./configure --help #可查看安装选项

./configure --prefix=/usr/local/python27 

make && make install


4、安装ipython

tar xvzf ipython-1.2.1.tar.gz

调用python来安装

/usr/local/python27/bin/python2.7 setup.py build  #编译

/usr/local/python27/bin/python2.7 setup.py install #安装,它会安装到/usr/local/python27/bin/

做软连接到

ln -sv /usr/local/python27/bin/python2.7 /usr/bin/python27

ln -sv /usr/local/python27/bin/ipython /usr/bin/ipython


至此安装完毕,python27即可使用,原有旧版本输入python仍可以使用。