最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[记录]CentOS中再次重新编译安装Python 2.7

CentOS crifan 4715浏览 0评论

之前已经把CentOS的Python从2.6升级到了2.7了:

[记录]CentOS 6中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)

-》https://pypi.python.org/packages/0d/13/ce6a0a22220f3da7483131bb8212d5791a03c8c3e86ff61b2c6a2de547cd/setuptools-26.0.0.tar.gz#md5=846e21fea62b9a70dfc845d70c400b7e

-》https://pypi.python.org/packages/0d/13/ce6a0a22220f3da7483131bb8212d5791a03c8c3e86ff61b2c6a2de547cd/setuptools-26.0.0.tar.gz

-》

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

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.199 seconds, using 22.15MB memory