Linux下安装Python2.7
CentOS6.8 中默认安装了Python2.6,但是很多应用需要使用Python2.7,于是要学会如何在Linux下安装Python2.7,这里记录一下,免得以后需要的时候,重新找资料琢磨。此处下载了Python2.7.15
1、下载Python2.7.15
================
$wget https:
//www
.python.org
/ftp/python/2
.7.9
/Python-2
.7.15.tgz
2、解压安装包、编译、安装
=======================
$tar -xzf Python-2.7.15.tgz
$cd Python2.7.15
$./configure --prefix=/usr/local/Python2.7.15
$make
$make install
3、系统自带了Python2.6,因此需要让python命令指向python2.7
================================================
$ln -s /usr/local/Python2.7.15/bin/python /usr/bin/python2.7
$ln -s /usr/bin/python2.7 /usr/bin/python
参考资料:
1、https://www.cnblogs.com/toulanboy/articles/7753502.html
2、https://www.python.org/