 <p>I don think a sheebang line alone would do it.</p> <p>You could try putting in </p> <pre><code>#! /usr/bin/env python2.7 </code></pre> <p>though. - But the thing that really would be consistent for you would be to use virtual python environments through virtualenv.</p> <p>Please, check <a href="http://www.virtualenv.org/en/latest/virtualenv.html" rel="nofollow">http://www.virtualenv.org/en/latest/virtualenv.html</a> - Otherwise you will risk having code running with the 2.7 Python but trying to load python 2.6 modules and libraries, and worse scenarios still.</p> <p>Also, the recommendation for having two same-major-version Python in a system is to keep both in different prefixes, like the system one in /usr, and the other in /opt (/usr/local won't suffice for a clear separation).</p>