简体   繁体   English

无法导入模块“lambda_function”:/lib64/libc.so.6:找不到版本“GLIBC_2.18”

[英]Unable to import module 'lambda_function': /lib64/libc.so.6: version `GLIBC_2.18' not found

We need to do file transfer from AWS lambda to remote machine.我们需要将文件从 AWS lambda 传输到远程机器。 We are using fabric for this.我们为此使用织物。 Till last week, AWS lambda is working fine.直到上周,AWS lambda 运行良好。 Today we created new zip file and uploaded to AWS lambda and it is throwing below error.今天我们创建了新的 zip 文件并上传到 AWS lambda,它抛出以下错误。

[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /var/task/cryptography/hazmat/bindings/_rust.abi3.so)

But if we upload old zip file (last week zip file) to AWS lambda, it is working fine.但是,如果我们将旧的 zip 文件(上周 zip 文件)上传到 AWS lambda,它工作正常。 Not sure why this is happening as we haven't done any changes.不确定为什么会发生这种情况,因为我们没有进行任何更改。

The only difference I observed with both zip files is old zip file contains 'pip-20.1.1.dist-info' and new zip file contains 'pip-22.0.4.dist-info'.我观察到的两个 zip 文件的唯一区别是旧的 zip 文件包含“pip-20.1.1.dist-info”,新的 zip 文件包含“pip-22.0.4.dist-info”。

I went through lot of stack overflow questions and did some research online as below.我经历了很多堆栈溢出问题,并在网上做了一些研究,如下所示。

Above links are suggesting that以上链接暗示

cryptography>=35.0, plus pip>=20.3 - downloads wrong cryptography anywheel package (GLIBC_2.18 error) #1063

and suggesting to downgrade cryptography to 3.4.8 to fix the issue.并建议将加密降级到 3.4.8 以解决此问题。 I downgraded as suggested but it didn't fix the issue.我按照建议降级,但没有解决问题。

I also downgraded pip version.我还降级了 pip 版本。 Now new zip file also contains same 'pip-20.1.1.dist-info' but still I am facing the same issue with the new zip file.现在新的 zip 文件也包含相同的“pip-20.1.1.dist-info”,但我仍然面临与新的 zip 文件相同的问题。

More details:更多细节:

I am using virtualenv.我正在使用虚拟环境。 My requirements.txt only contains one line fabric==2.7.1 .我的 requirements.txt 只包含一行fabric==2.7.1 I am installing the packages locally on aws ec2 instance under virtualenv using pip install -r requirements.txt .我正在使用pip install -r requirements.txt在 virtualenv 下的 aws ec2 实例上本地安装软件包。

Can anyone please let me know how to fix the issue.谁能告诉我如何解决这个问题。

It looks mostly like a deployment issue.它看起来主要是部署问题。 Either of the two:两者之一:

  1. Bundling the libraries is not right, and they are not found in the function. To verify that you can get to the function in the AWS console, and export it as a zip file.捆绑库不对,在 function 中找不到。验证您可以在 AWS 控制台中访问 function,并将其导出为 zip 文件。 See if all needed packages are in the zip.查看 zip 中是否包含所有需要的包。
  2. The package isn't compiled with the right architecture. package 未使用正确的体系结构编译。 Some Python libraries are being compiled specifically on the host on which they are being installed (including some that you've mentioned).某些 Python 库是专门在安装它们的主机上编译的(包括您提到的一些库)。 So if the deployment runs from a macOS, for example, it wouldn't work on a Lambda function. To fix that - either run the deployment from a Linux machine, or if you're using serverless, you can use the serverless-python-requirements .因此,如果部署从 macOS 运行,例如,它不会在 Lambda function 上运行。要解决这个问题 - 从 Linux 机器运行部署,或者如果您使用的是无服务器,则可以使用无服务器-python -要求

暂无
暂无

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

相关问题 /lib64/libc.so.6:找不到版本“GLIBC_2.32” - /lib64/libc.so.6: version `GLIBC_2.32' not found /lib64/libm.so.6:找不到版本“GLIBC_2.27”(节点需要) - /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node) 无法导入模块“lambda_function”: - Unable to import module 'lambda_function': AWS Lambda 层无法导入模块“lambda_function”:没有名为“pyarrow.lib”的模块 - AWS Lambda Layer Unable to import module 'lambda_function': No module named 'pyarrow.lib' OpenCV - AWS Lambda - /lib64/libz.so.1:未找到版本“ZLIB_1.2.9” - OpenCV - AWS Lambda - /lib64/libz.so.1: version `ZLIB_1.2.9' not found /lib64/libm.so.6:未找到版本“GLIBC_2.27”- 将最新的 gatsby 应用程序部署到 Amazon Amplify 时出错 - /lib64/libm.so.6: version `GLIBC_2.27' not found - Error deploying latest gatsby app to Amazon Amplify AWS Lambda - 无法导入模块“lambda_function” - AWS Lambda - unable to import module 'lambda_function' 无法导入模块“lambda_function”:没有名为“pymongo”的模块 - Unable to import module 'lambda_function': No module named 'pymongo' AWS Lambda Opencv(“无法导入模块‘lambda_function’:libgthread-2.0.so.0:无法打开共享对象文件:没有这样的文件或目录”) - AWS Lambda Opencv ("Unable to import module 'lambda_function': libgthread-2.0.so.0: cannot open shared object file: No such file or directory") 无法导入模块“lambda_function”:没有名为“psycopg2._psycopg aws lambda 函数”的模块 - Unable to import module 'lambda_function': No module named 'psycopg2._psycopg aws lambda function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM