I am using a module that can only be found in python 2.7, so when I run my script I have to specify python2.7 script instead of just script. I know there are bigger issues out there, but still I was wondering –
is it possible, when writing a python script, to set the interpreter to 2.7 by default?
Maybe by setting #! /usr/bin/env python for example?
I am using a module that can only be found in python 2.7, so
Share
Most unix environments will have the
python2.7executable, such that you can write:Obviously this doesn’t help much on windows. You can also at least check the python version once you are started, although it won’t help you run the later version if it is available: