title: AWS lambda No module named markupsafe error with jinja2
body: <p>I created a lambda function to send emails in a specific template and for the template i am using jinja2 packaged along with lambda. My lambda import statements are like this below:</p>
  
  <pre><code>import datetime
  import boto3
  import threading
  import time
  
  from botocore.exceptions import ClientError
  from boto3.dynamodb.conditions import Key, Attr
  from libs.jinja2 import Environment, FileSystemLoader
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/bAfSZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bAfSZ.png" alt=""></a></p>
  
  <p>and my libs folder consists of jinja2 and when it failed with <code>No module named Markupsafe</code> i pip installed markupsafe into the libs folder as target and zipped the app(source code) and libs folder together. But it still doesn't work and fails with this below error:</p>
  
  <pre><code>{
    "errorMessage": "Unable to import module 'app.main': No module named 'markupsafe'",
    "errorType": "Runtime.ImportModuleError"
  }
  </code></pre>