title: How to source virtualenv activate in a Bash script
body: <p>How do you create a Bash script to activate a Python virtualenv?</p>
  
  <p>I have a directory structure like:</p>
  
  <pre><code>.env
      bin
          activate
          ...other virtualenv files...
  src
      shell.sh
      ...my code...
  </code></pre>
  
  <p>I can activate my virtualenv by:</p>
  
  <pre><code>user@localhost:src$ . ../.env/bin/activate
  (.env)user@localhost:src$
  </code></pre>
  
  <p>However, doing the same from a Bash script does nothing:</p>
  
  <pre><code>user@localhost:src$ cat shell.sh
  #!/bin/bash
  . ../.env/bin/activate
  user@localhost:src$ ./shell.sh
  user@localhost:src$ 
  </code></pre>
  
  <p>What am I doing wrong?</p>