python的升级(2.6------>2.7.x)
如下地址:
转载自:
代码如下:
1 #!/bin/bash 2 yum install -y gcc 3 yum install zlib-devel openssl-devel sqlite-devel 4 wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz 5 tar -zxvf Python-2.7.8.tgz 6 cd Python-2.7.8 7 ./configure --prefix=/usr/local/python 8 make 9 make install10 cd ~11 mv /usr/bin/python /usr/bin/python2.612 ln -sf /usr/local/python/bin/python2.7 /usr/bin/python13 sed -i 's/#!\/usr\/bin\/python/#!\/usr\/bin\/python2.6/' /usr/bin/yum14 wget https://bootstrap.pypa.io/get-pip.py15 python get-pip.py16 ln -sf /usr/local/python/bin/pip /usr/bin/pip17 ln -sf /usr/local/python/bin/easy_install /usr/bin/easy_install18 pip install ipython19 ln -s /usr/local/python/bin/ipython /usr/bin/ipython20 yum install readline-devel21 yum install patch22 pip install readline