DEV Community

Discussion on: Using external Python packages with AWS Lambda layers

Collapse
 
mmascioni profile image
Matt Mascioni

Hi Nayeem! Looks like the layer dependencies might not be available in your function. A few places this could've gone wrong:

  • Were there any errors raised while you were building dependencies using the Docker image?
  • Does the runtime Python version on your Lambda layer match the one of your Lambda function, and were there any errors raised when adding the layer to your function?
Collapse
 
uraniumreza profile image
Nayeem Reza

No, I haven't faced any error while building the Docker Image, also no errors while adding the layer to the function! And I'm using Python3.7 in both the function and layer runtime!

Thread Thread
 
mmascioni profile image
Matt Mascioni

Super weird! Sorry it's been causing problems - are you able to share the code you're using for your function? I gave it a shot using the haversine package as well, hard-coded one of their examples in and it seemed to work - attached a gist of the function here (didn't use it with API Gateway though)