在https://www.Python.org/ftp/python/下找到您所需的python版本
如https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz
下载python
wgethttps://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz
解压编译安装
# tar zxvf Python-3.4.1.tgz
#cdPython-3.4.1.tgz
#./configure
#make
#make install
此时,新版本的python没有覆盖原来的版本,先将原来的python重命名
@H_502_42@# mv /usr/bin/python /usr/bin/python_old
@H_502_42@# ln -s "python下载编译目录" /usr/bin/python
@H_502_42@# python
@H_502_42@Python 3.4.1 (default,Aug 25 2014,10:04:52)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] onLinux
Type "help","copyright","credits" or "license" for more information.
>>>
@H_502_42@
@H_502_42@安装成功!
原文链接:https://www.f2er.com/centos/380186.html