0
votes

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?

1
how are you calling your script? Also how can you tell its 2.6?runz0rd
We'd definitely need to see how you're invoking your script, and what shebang line (if any) at the top of the script contains. Might also be useful to provide the sys.executable your script reports, and the results of ldd on that executable run via command prompt and also via subprocess.check_call (in case it differs).ShadowRanger

1 Answers

1
votes

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