title: How to access an AWS Lambda environment variable from Python
body: <p>Using the new <a href="http://docs.aws.amazon.com/lambda/latest/dg/env_variables.html" rel="noreferrer">environment variable support in AWS Lambda</a>, I've added an env var via the webui for my function.</p>
  
  <p>How do I access this from Python? I tried:</p>
  
  <pre><code>import os
  
  MY_ENV_VAR = os.environ['MY_ENV_VAR']
  </code></pre>
  
  <p>but my function stopped working (if I hard code the relevant value for <code>MY_ENV_VAR</code> it works fine).</p>