We have installed Centos 6.x in one or our VM and it has come with default Python 2.6 installed. On top of it we have installed Python 2.7 and configured Python 2.7 as default in /usr/bin/. When I type python in my command line it gives version Python 2.7. But when I execute my python script file test.py it is using Python 2.6 instead of Python 2.7. Did I miss any configurations to tell my scripts to use Python 2.7 instead of Python 2.6 on my machine?
Since it sounds like you set up your command line correctly, I would first try looking at your script. Did you try including the shebang at the top of your script? #!/usr/bin/env python2.7
How to tell python script files to use particular version of python if there are multiple versions of python are installed on the machine