之前已经把CentOS的Python从2.6升级到了2.7了:
但是现在由于没有安装sqlite,所以在安装了sqlite后,需要重新编译Python
所以再去重新编译安装Python 2.7
参考:
Centos 6.4 python 2.6 升级到 2.7 – Just Coding! – 博客频道 – CSDN.NET
tar xf Python-2.7.12.tar cd Python-2.7.12 ./configure –prefix=/usr/local make make install |
注:
这次没去用make altinstall
希望现在安装到python 2.7变成默认的Python
➜ Python-2.7.12 python -V Python 2.7.12 ➜ Python-2.7.12 ls /usr/bin/py* -l -rwxr-xr-x 1 root root 78 Jul 24 2015 /usr/bin/pydoc lrwxrwxrwx 1 root root 24 Aug 15 11:45 /usr/bin/python -> /usr/local/bin/python2.7 lrwxrwxrwx 1 root root 6 Jun 2 16:28 /usr/bin/python2 -> python -rwxr-xr-x 1 root root 9032 Jul 24 2015 /usr/bin/python2.6 |
再去:
setuptools 26.0.0 : Python Package Index
-》setuptools-26.0.0.tar.gz (md5)
-》
wget –no-check-certificate https://pypi.python.org/packages/0d/13/ce6a0a22220f3da7483131bb8212d5791a03c8c3e86ff61b2c6a2de547cd/setuptools-26.0.0.tar.gz cd setuptools-26.0.0 python2.7 setup.py install |
然后:
curl https://bootstrap.pypa.io/get-pip.py | python2.7 – |
就可以了。
转载请注明:在路上 » [记录]CentOS中再次重新编译安装Python 2.7