AWS Lambda and python numpy module

前端 未结 5 1470
梦毁少年i
梦毁少年i 2021-01-07 08:57

I am trying to import a python deployment package in aws lambda. The python code uses numpy. I followed the deployment package instructions for virtual env but it still gave

5条回答
  •  渐次进展
    2021-01-07 09:22

    NumPy must be compiled on the platform that it will be run on. Easiest way to do this is to use Docker. Docker has a lambda container. Compile NumPy locally in Docker with the lambda container, then push to AWS lambda.

    The serverless framework handles all this for you if you want an easy solution. See https://stackoverflow.com/a/50027031/1085343

提交回复
热议问题