2

I am attempting to upload a .zip file from S3 to run on a lambda function. When doing so, I get the following error:

START RequestId: 578fc1bb-9c82-11e7-b2c9-91da0a832381 Version: $LATEST
Unable to import module 'create_heatmap': No module named create_heatmap

END RequestId: 578fc1bb-9c82-11e7-b2c9-91da0a832381
REPORT RequestId: 578fc1bb-9c82-11e7-b2c9-91da0a832381  Duration: 0.31 ms   Billed Duration: 100 ms     Memory Size: 128 MB Max Memory Used: 18 MB

enter image description here

Above is the folder which I zipped up and uploaded to lambda. You can see there is a create_heatmap.py file in this top level directory.

The handler configuration I have laid out can be seen below: enter image description here

And last, here is the lambda_handler function in create_heatmap.py.

def lambda_handler(event,context):
    hm = Heatmap(course_name=event.get('course_name',None),horizontal=event.get('horizontal',[]),num_topics=event.get('num_topics',10))
    hm.run()

I cannot figure out why this is not working at the moment. Any suggestions would be greatly appreciated.

Joe Urc
  • 487
  • 5
  • 19
  • I would remove dependencies and do a quick test with a minimal Python source file that simply includes a lambda_handler(event, context) handler that prints "Hello World!". – jarmod Sep 18 '17 at 15:36

1 Answers1

0

Make sure the permissions on the files in the archive are at least 444 -- this tripped me up for awhile. If that doesn't work, check out the other answers on this post.

jcgrowley
  • 709
  • 1
  • 8
  • 21