pymssql package does not work with lambda in aws

混江龙づ霸主 提交于 2021-02-08 08:29:41

问题


How do we create a pymssql package for lambda. I tried creating it using pip install pymssql -t . When I run my lambda function it complaints saying that Unable to import module 'lambda_function': No module named lambda_function

I follow the steps on this link http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html

I have a windows machine


回答1:


Glad that it worked for you, could you please share the working process for your, me too tried different trial and error steps and ended up with the following one which is working fine in AWS Lambda, I am using PYMSSQL package only.

1) did 'pip install pymssql' on amazon EC2 instance as under the hood Amazon uses Linux AMIs to run their Lambda functions.

2) copied the generated .so files and packaged inside the Lambda deployment package hope this will helps others as well who are searching for the solution.

Hope this will help you further, can you please share what you did to connect to MSSQL server using AWS Lambda.

Below is the folder structure of my lambda deployment package




回答2:


Finally i could do it. It didnt worked with windows packages so used ubuntu to package freetds.so file and it worked.



来源:https://stackoverflow.com/questions/37566890/pymssql-package-does-not-work-with-lambda-in-aws

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!