centos7系统默认安装的python是v2版本的,但有些程序需要python3程序支持,如何在centos7中部署python3呢?
yum install python36-3.6.6-5.el7.x86_64
1、默认python程序进行备份
mv /usr/bin/python /usr/bin/pythonbak
2、修改默认python为python3
ln -s /usr/bin/python3.6 /usr/bin/python
3、修改yum的默认python版本
[root@dba ~]# cat /usr/bin/yum #!/usr/bin/python -->修改为 #!/usr/bin/python2.7 import sys try: import yum except ImportError: print >> sys.stderr, """\ There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: %s
1、yum程序依赖python,修改系统默认python版本后,注意修改yum程序的python信息
原文:https://www.cnblogs.com/lkj371/p/12793631.html