centos7如何用 yum安装python3,安装Python3后,yum失效了,怎么解决?
查看Python版本
# python -V Python 2.7.5
yum软件库
# yum install epel-release
安装Python
# yum search python3*
我这里显示有Python34和Python36,继续
# yum install python34 …… Is this ok [y/d/N]: y Downloading packages: python34-libs-3.4.9-1.el7.x86_64.rpm | 8.3 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction 正在安装 : python34-libs-3.4.9-1.el7.x86_64 1/2 正在安装 : python34-3.4.9-1.el7.x86_64 2/2 验证中 : python34-3.4.9-1.el7.x86_64 1/2 验证中 : python34-libs-3.4.9-1.el7.x86_64 2/2 已安装: python34.x86_64 0:3.4.9-1.el7 作为依赖被安装: python34-libs.x86_64 0:3.4.9-1.el7 完毕!
软连接
# cd /usr/bin # rm python # ln -s python3.4 python # python -V Python 3.4.9
完毕,我这里的因为Python直接安装在了目录/usr/bin下,如果你的不是这样注意ln的位置一定要正确。
ln -s 源位置 目标位置
继续解决Yum不能使用的问题,因为老版本的Python我们并没有删除,所以直接指向老版本就可以了。
# vi /usr/bin/yum
改完后如图
改过不行,自己ll看看目录下老版本的文件名
全文结束,参考文章列表:
https://stackoverflow.com/questions/8087184/installing-python-3-on-rhel
标签: Python
版权声明:若文中没有特别声明皆为原创文章,转载时请以链接形式注明文章出处与原文链接。
非书面授权,禁止转载。本作品采用 CC BY-NC-ND/2.5/CN 许可协议。
如果帮您解决了问题,可以给小编打赏,小编不抽烟不喝酒,6元就够吃个泡面了,感激不尽。
非书面授权,禁止转载。本作品采用 CC BY-NC-ND/2.5/CN 许可协议。
如果帮您解决了问题,可以给小编打赏,小编不抽烟不喝酒,6元就够吃个泡面了,感激不尽。