在Lambda中导入Snowflake Python连接器时遇到库引入问题。

huangapple go评论65阅读模式
英文:

Running into library issues importing snowflake python connector into lambda

问题

我正在尝试将snowflake-connector-python构建为Lambda层,以在Snowflake上执行SQL。我正在使用此处列出的依赖项构建带有Amazon Linux EC2实例上的依赖项的zip文件 - https://github.com/snowflakedb/snowflake-connector-python/blob/main/tested_requirements/requirements_39.reqs

Python运行时版本 - 3.9 snowflake-connector-python - 3.0.4

我按照建议的过程构建了带有连接器和依赖项的zip文件,并将它们上传为Lambda层。然而,当我运行一个简单的应用程序来测试导入时 -

import snowflake.connector

这是错误消息 -

响应 { "errorMessage": "无法导入模块'lambda_function':/lib64/libc.so.6: 找不到版本'GLIBC_2.28'(需要/opt/python/cryptography/hazmat/bindings/_rust.abi3.so)", "errorType": "Runtime.ImportModuleError", "requestId": "5245b8b3-bd72-4e8c-9ead-518418617d93", "stackTrace": [] }

我导入的cryptography版本与git存储库中列出的确切版本相同。是否有人遇到导入snowflake connector时类似的问题。

谢谢。

英文:

I am trying to build, snowflake-connector-python, as a lambda layer to execute SQL on Snowflake. I am using the dependencies listed here to build the zip file with dependencies on Amazon linux EC2 instance - https://github.com/snowflakedb/snowflake-connector-python/blob/main/tested_requirements/requirements_39.reqs

Python runtime version - 3.9 snowflake-connector-python - 3.0.4

I followed the recommended process to build the zip file with connector and dependencies and uploaded them as a lambda layer. However, when I run a simple app to test the import -

import snowflake.connector

this is the error message -

> Response { "errorMessage": "Unable to import module 'lambda_function':
> /lib64/libc.so.6: version `GLIBC_2.28' not found (required by
> /opt/python/cryptography/hazmat/bindings/_rust.abi3.so)",
> "errorType": "Runtime.ImportModuleError", "requestId":
> "5245b8b3-bd72-4e8c-9ead-518418617d93", "stackTrace": [] }

cryptography version I imported is the exact version listed in the git repo. Has anyone faced similar issues importing snowflake connector.

Thank you.

答案1

得分: 1

问题出在使用AL2012 Linux版本创建zip文件夹时。一旦我切换到AL2(默认的Lambda Linux版本),它就正常工作了。感谢您的关注!

链接:https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

英文:

Issue was with creating the zip folder using AL2012 linux version. Once I change to AL2 which is the default lambda linux version, it worked fine. Thanks for checking-in!

https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

huangapple
  • 本文由 发表于 2023年7月10日 22:48:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/76654906.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定