一.安装步骤
1.检查系统python
CentOS 6.8自带的是Python 2.6.6,yum中最新的也是Python 2.6.6,只能下载Python 2.7.12的源代码自己编译安装。如下图:
- 安装Development tools
#yum -y groupinstall "Development tools" - 安装编译Python需要的包
#yum install zlib-devel -y
#yum install bzip2-devel -y
#yum install openssl-devel -y
#yum install ncurses-devel -y
#yum install sqlite-devel -y
#yum install tcl-devel –y
#yum install tk-devel -y
4.下载并解压Python 2.7.12的源代码
#cd /opt
#wget --no-check-certificate https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz
#tar xf Python-2.7.12.tar.xz
#cd Python-2.7.12
#tar xf Python-2.7.12.tar.xz
#cd Python-2.7.12
- 编译与安装Python 2.7.12
#./configure --prefix=/usr/local
#make && make install
6.将python命令指向Python 2.7.12cd /usr/bin
#rm –rf python
#ln -s /usr/local/bin/python2.7 /usr/bin/python
#python –version
由上图所示 python2.7安装完成
如果对此有兴趣,请扫下面二维码免费获取更多详情
原文地址:http://blog.51cto.com/11233498/2169991
时间: 2024-10-06 03:52:00