title: switching between python 2 and 3 versions while scripting
body: <p>I usually develop with python 2.7, but would like to start creating some tools in python 3.x. What is the easiest way to have both running side-by-side, while keeping some semblance of control over what libraries I have installed where... </p>
  
  <p>If I use <code>pyenv</code> to switch between versions, will it propagate to a generic shebang line? Something like</p>
  
  <pre><code>#!/usr/bin/env python
  </code></pre>
  
  <p>or even better, can I specify which python in the shebang?</p>
  
  <pre><code>#!/usr/bin/env python3
  </code></pre>
  
  <p>I am anticipating a lot of "Use <code>virtualenv</code>" replies. Is this really the only way to do it?  I feel like I would like to have the "base" python on my system with whatever libraries I have installed so that I can change between the two environments by typing something simple like <code>pyenv global 3.2.3</code> </p>
  
  <p>I am using OSX, Mountain Lion at the moment.</p>
  
  <hr>
  
  <p>Trying to explain it a little better, I have two alternative questions:</p>
  
  <ul>
  <li><p>If I use something like <code>virtualenv</code>, will I lose the ability to run python2 and python3 scripts alternately, without changing the environment (i.e., just via shebang)?</p></li>
  <li><p>In contrast, if I use two independent version installations, how can I control/know what will be installed by <code>pip</code> or <code>easy_install</code> for example. </p></li>
  </ul>
  
  <hr>
  
  <p><strong>UPDATE</strong>: Currently using <code>python3</code> in the shebang line, and using <code>pip3</code> to install packages to python3... Seems to work fine.</p>