标签:
CentOS 6.7默认的Python版本为2.6.6,现升级为Python 2.7.11
1、安装编译环境
yum groupinstall "Development tools"
2、安装依赖的包
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel
3、下载Python
wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz tar zxvf Python-2.7.11.tgz cd Python-2.7.11
4、编译安装
./configure --prefix=/usr/local/python make && make install
5、直接调用
/usr/local/python/bin/python
6、替换旧版本
ln -sf /usr/local/python/bin/python /usr/bin/python
7、查看版本
python -V
Python 2.7.11
CentOS 6.7 final编译安装Python 2.7.11
标签:
原文地址:http://www.cnblogs.com/imzye/p/5100778.html