美文网首页
centos下升级python

centos下升级python

作者: 真是明明 | 来源:发表于2018-04-15 10:37 被阅读35次

升级python36:

wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz

tar -zxvf Python-3.6.0.tgz
cd Python-3.6.0

编译配置:

./configure --prefix=/usr/local/python
./configure
./configure --with-ssl
这3种 用了最后一种不然提示ssl错误

make && make install

2018-05-18 出现错误

yum -y install ntp make openssl openssl-devel pcre pcre-devel libpng libpng-devel libjpeg-6b libjpeg-devel-6b freetype freetype-devel gd gd-devel zlib zlib-devel gcc gcc-c++ libXpm libXpm-devel ncurses ncurses-devel libmcrypt libmcrypt-devel libxml2 libxml2-devel imake autoconf automake screen sysstat compat-libstdc++-33 curl curl-devel
解决

Python默认安装路径是:/usr/local/lib/pythonx.x
运行命令:/usr/local/bin/python -V 查看Python版本,看到x.x说明安装成功

mv /usr/bin/python /usr/bin/python.bak
ln -s /usr/local/bin/python2.6 /usr/bin/python

vim /usr/bin/yum
修改第一句:
!#/usr/bin/python原来的x.x

以前2.6更新至2.7 2018-04-15更新至3.6

参考文章:
https://www.linuxidc.com/Linux/2012-03/56384.htm
https://blog.csdn.net/qq_33841518/article/details/72831372

相关文章

网友评论

      本文标题:centos下升级python

      本文链接:https://www.haomeiwen.com/subject/gmkdkftx.html