Centos 6 安装 python2.7 和 pip

一、安装 python2.7

[root@crazy-acong ~]# cd /data/tools/
[root@crazy-acong tools]# yum groupinstall "Development tools"
[root@crazy-acong tools]# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel
[root@crazy-acong tools]# wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz        
[root@crazy-acong tools]# tar -xf Python-2.7.13.tar.xz 
[root@crazy-acong tools]# cd Python-2.7.13
[root@crazy-acong Python-2.7.13]# ./configure
[root@crazy-acong Python-2.7.13]# make
[root@crazy-acong Python-2.7.13]# make install
[root@crazy-acong Python-2.7.13]# mv /usr/local/bin/python /usr/local/bin/python2.6
[root@crazy-acong Python-2.7.13]# ln -s /usr/local/bin/python2.7 /usr/local/bin/python

此时重新连接ssh
[root@crazy-acong ~]# python -V
Python 2.7.13

二、安装 pip

参考链接:http://www.cnblogs.com/CongZhang/p/5111195.html

转载于:https://www.cnblogs.com/CongZhang/p/6739722.html

你可能感兴趣的:(python,运维)