I have two versions of python installed. If I don’t run the scl command, I will use python 2.7, but when I use scl command, it swith to use python 3. What is the difference between these two methods?
When I try to see which verion of python ansible uses, it says version 2.7. how could I make anislbe use version 3.
[root@g0dvlnxjyu01 ~]# python -V
Python 2.7.5
[root@g0dvlnxjyu01 ~]# scl enable rh-python36 bash
[root@g0dvlnxjyu01 ~]# python -V
Python 3.6.3
[root@g0dvlnxjyu01 ~]# ansible --version | grep “python version”
python version = 2.7.5 (default, Sep 12 2018, 05:31:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
[root@g0dvlnxjyu01 ~]# which version
/usr/bin/which: no version in (/opt/rh/rh-python36/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/opt/omi/bin:/root/.local/bin:/root/Repo/DevOps/AWS/terra-test:/root)
[root@g0dvlnxjyu01 ~]# which python
/opt/rh/rh-python36/root/usr/bin/python
[root@g0dvlnxjyu01 ~]#