python lambda can't detect packaged modules
Question: I'm trying to create a lambda function by uploading a zip file with a single
.py file at the root and 2 folders which contain the requests lib downloaded
via pip.

Running the code local works file. When I zip and upload the code I very often
get this error:

`Unable to import module 'main': No module named requests`

Sometimes I do manage to fix this, but its inconsistent and I'm not sure how
I'm doing it. I'm using the following command:

in root dir `zip -r upload.zip *`

This is how I'm importing requests:

`import requests`

FYI: 1\. I have attempted a number of different import methods using the exact
path which have failed so I wonder if thats the problem? 2\. Every time this
has failed and I've been able to make it work in lambda, its involved a lot of
fiddling with the zip command as I thought the problem was I was zipping the
contents incorrect and hiding them behind an extra parent folder.

Looking forward to seeing the silly mistake i've been making!

Adding code snippet:

    
    
    import json         ##Built In
    import requests     ##Packaged with
    import sys          ##Built In
    
    def lambda_function(event, context):
    
    alias = event['alias']
    message = event['message']
    input_type = event['input_type']
    
    if input_type == "username":
        username = alias
    elif input_type == "email":
        username = alias.split('@',1)[0]
    elif input_type is None:
        print "input_type 'username' or 'email' required. Closing..."
        sys.exit()
    
    payload = {
                "text": message,
                "channel": "@" + username,
                "icon_emoji": "<an emoji>",
                "username": "<an alias>"
              }
    
    r = requests.post("<slackurl>",json=payload)
    print(r.status_code, r.reason)
    


Answer: I got some help outside the stackoverflow loop and this seems to consistently
work.

`zip -r upload.zip main.py requests requests-2.9.1.dist-info`

