title: Activate a Conda Environment in Python Script
body: <p>I'm converting a shell script to Python and I'm searching for a way to activate and deactivate a conda environment programmatically in Python. I've looked through the Conda code on Github and haven't been able to find a good solution.</p>
  
  <p>I need the environment to be activated so that I can run multiple statements in it.  For example:</p>
  
  <pre><code>source activate my_env
  easy_install numpy 
  backup_db
  initialize_db
  source deactivate 
  </code></pre>
  
  <p>I'm having no luck using subprocess. :-(</p>