title: Activating virtualenv from inside a running Python3 session
body: <p>The documentation for <code>virtualenv</code> says that to activate an environment from inside python, use</p>
  
  <pre><code>activate_this = '/path/to/env/bin/activate_this.py'
  execfile(activate_this, dict(__file__=activate_this))
  </code></pre>
  
  <p>But <code>execfile</code> does not exist in Python 3. If I try to use <code>exec(open("venv/bin/activate_this.py").read())</code>, it complains </p>
  
  <pre><code>AssertionError: You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))
  </code></pre>
  
  <p>And that makes sense, because <code>activate_this.py</code> makes reference to <code>__file__</code>. </p>
  
  <p>How do I activate virtualenv from inside python 3?</p>