Unable to import grequests for AWS Lambda

前端 未结 2 1820
日久生厌
日久生厌 2021-01-12 11:16

I\'m running an AWS Lambda script with a Python 2.7 runtime. However, whenever it initializes it begins to import the grequests library but fails b

相关标签:
2条回答
  • 2021-01-12 12:05

    As Gevent is based on libev it is most likely compiling binaries when being installed via pip.

    You need to make sure that you are deploying binaries that are compiled for Amazon Linux if you want them to be executable in AWS Lambda. You can do so by building your deploy package on an EC2 instance that is running Amazon Linux.

    Also check out this answer and this tutorial.

    0 讨论(0)
  • 2021-01-12 12:19

    I had to build gevent from src on an Amazon Linux instance. I put the resultant files in a zip if anyone needs them--just include them in your uploaded Lambda zip and you should be concurrent-ing like a boss.

    https://github.com/brandonmp/aws-lambda-grequests

    0 讨论(0)
提交回复
热议问题