title: How to add boto library to an python-based AWS lambda function?
body: <p>I want to create a lambda function in python3.7 that it will use <code>boto</code> to perform some AWS query.</p>
  
  <p><a href="https://i.stack.imgur.com/zjNvW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zjNvW.png" alt="enter image description here"></a></p>
  
  <p>The function is very simple. I added <code>import boto</code> to the simple vanilla template to try out how to enable <code>boto</code>.</p>
  
  <pre><code>import json
  
  import boto
  
  def lambda_handler(event, context):
      # TODO implement
      return {
          'statusCode': 200,
          'body': json.dumps('Hello from Lambda!')
      }
  </code></pre>
  
  <p>Needless to say, it fails:</p>
  
  <pre><code>Response:
  {
    "errorMessage": "Unable to import module 'lambda_function': No module named 'boto'",
    "errorType": "Runtime.ImportModuleError"
  }
  </code></pre>
  
  <p>So how can I add <code>boto</code> to my code?</p>
  
  <p>I have checked out Layers and it is empty.</p>
  
  <p><a href="https://i.stack.imgur.com/8s1rC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8s1rC.png" alt="enter image description here"></a></p>
  
  <p>I think I can create on by uploading a zip file. But what should I put inside the zip file? What sort of directory structure is Lambda expecting?</p>