pymssql包不适用于AWS中的Lambda [英] pymssql package does not work with lambda in aws

查看:60
本文介绍了pymssql包不适用于AWS中的Lambda的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何为lambda创建pymssql包.我尝试使用创建它pip安装pymssql -t.当我运行lambda函数时,它抱怨说无法导入模块"lambda_function":没有名为lambda_function的模块

我遵循此链接上的步骤

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

解决方案

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

这篇关于pymssql包不适用于AWS中的Lambda的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆