title: Dealing with multiple python versions when python files have to use #!/bin/env python
body: <p>I have this problem: <br/> <br/>
  <code>System A</code> runs Ubuntu and needs <code>Python 2.6</code> for a bunch of different things.<br/>
  I Installed <code>Python 2.7</code> separately on <code>System A</code><br/>
  <code>System B</code> has <code>Python 2.7</code> natively.<br/></p>
  
  <p>I have a python script <code>BLAH</code> which says <code>#!/bin/env python</code> up top. <br/>
  Further down it executes another script <code>SIGH</code>, which up top also says: <code>#!/bin/env python</code>. <br/></p>
  
  <p><code>BLAH</code> needs to run on either <code>System A</code> or <code>System B</code>, and it always needs to run <code>Python 2.7</code></p>
  
  <p>----<br/>
  Part of my solution so far:<br/>
  Have a wrapper script that first tries to see if <code>which python</code> is pointing to Python 2.7 <br/>
  If that's okay then run <code>BLAH</code> with that path for python.<br/>
  Else try <code>which python2.7</code> and use that path to run <code>BLAH</code> , and add that path to <code>env PATH</code>.<br/></p>
  
  <p>Problem with this solution is:<br/></p>
  
  <p>On <code>System A</code> (which has Python 2.7 installed separately)<br/>
  When <code>BLAH</code> executes, it runs with Python 2.7 because of the wrapper script I wrote (okay so far..) <br/>
  When <code>BLAH</code> spawns <code>SIGH</code>, <code>SIGH</code> uses the shebang to find python in the path and then it's in trouble because it's looking for python in <code>env</code>'s <code>PATH</code> and it should be looking for <code>python2.7</code> in the path. <br/></p>
  
  <p>Is there a clean way of handling this problem? <br/></p>
  
  <p>Thanks in advance!</p>