AWS Lambda import module error in python

后端 未结 21 1552
醉话见心
醉话见心 2020-12-07 19:56

I am creating a AWS Lambda python deployment package. I am using one external dependency requests . I installed the external dependency using the AWS documentation http://do

21条回答
  •  长情又很酷
    2020-12-07 20:06

    I had the error too. Turn out that my zip file include the code parent folder. When I unzip and inspect the zip file, the lambda_function file is under parent folder ./lambda.

    Use the zip command, fix the error:

    zip -r ../lambda.zip ./*
    

提交回复
热议问题