安装python3.5可能使用的依赖
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
到python官网找到下载路径, 用wget下载
wget https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tgz
解压tgz包
tar -zxvf Python-3.5.3.tgz
把python移到/usr/local下面
mv Python-3.5.3 /usr/local
删除旧版本的python依赖
ll /usr/bin | grep python rm -rf /usr/bin/python
进入python目录
cd /usr/local/Python-3.5.3/
配置 ./configure 编译 make make 编译,安装 make install
删除旧的软链接,创建新的软链接到最新的python
rm -rf /usr/bin/python ln -s /usr/local/bin/python3.5 /usr/bin/python python -V
升级python后如出现yum 安装报错 File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:因为yum包使用python2*等开发,修该为环境修改python3之后有问题,
解决:
修改文件/usr/bin/yum、/usr/libexec/urlgrabber-ext-down头中相应python为#!/usr/bin/python2.7
本文出自:http://blog.csdn.net/cz626626/article/details/70944609?utm_source=itdadao&utm_medium=referral
文章评论