简体   繁体   English

在 aws lambda 中找不到用于 python mssql 连接的模块

[英]no module found pyodbc in aws lambda for python mssql connection

AWS Lambda is showing me 'no module import error' for package pyodbc in my lambda function. AWS Lambda 在我的 lambda 函数中向我显示包 pyodbc 的“无模块导入错误”。 I've been using another library without error like this only getting error for this 'pyodbc' lib.我一直在使用另一个库而没有出现这样的错误,但只有这个“pyodbc”库出错。 I've added pyodbc installing with pip to my python code directory and upload them in zip to aws lambda.我已将使用 pip 安装的 pyodbc 添加到我的 python 代码目录中,并将它们以 zip 格式上传到 aws lambda。

You would need to ensure that the native libraries that pyodbc requires are present in the Lambda execution environment - either bundled as part of your deployment package or as a separate Lambda layer.您需要确保在 Lambda 执行环境中存在 pyodbc 所需的本机库 - 作为部署包的一部分或作为单独的 Lambda 层捆绑在一起。

See https://medium.com/@narayan.anurag/breaking-the-ice-between-aws-lambda-pyodbc-6f53d5e2bd26 for more details about this.有关更多详细信息,请参阅https://medium.com/@narayan.anurag/break-the-ice-between-aws-lambda-pyodbc-6f53d5e2bd26

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM