下载python3.4.3的源码包,解压,进入文件夹
./configure
make all
make install
make clean
make distclean
然后不要急着去python -V,这时候实际上你还是发现是2.6.6
执行
mv /usr/bin/python /usr/bin/python2.6
会问你是否overwrite2.6的配置,输入y
ln -s /usr/local/bin/python3.4 /usr/bin/python
这时候输入python -V,应该是3.4.3了
make install会报Ignoring ensurepip failure: pip 6.0.8 requires SSL/TLS
即使是装了mod_ssl也还是会有这条warning,不知为何
在更新完python之后,yum安装会报错(来源)
[root@name user]# yum
File "/usr/bin/yum", line 30
except KeyboardInterrupt, e:
解决方法:
vi /usr/bin/yum
将第一行"#!/usr/bin/python" 改为 "#!/usr/bin/python2.6"即可