简体   繁体   English

无法在 AWS 中使用 Python 的 Paramiko 库 Lambda Function

[英]Unable to use Python's Paramiko library in AWS Lambda Function

I have uploaded Paramiko library as a layer in the Lambda function. However, still when I am attempting to import the same, it is giving me the following error:我已经将 Paramiko 库作为图层上传到 Lambda function 中。但是,当我尝试导入相同的库时,仍然出现以下错误:

Response { "errorMessage": "Unable to import module 'lambda_function': No module named 'paramiko'", "errorType": "Runtime.ImportModuleError", "requestId": "8c81ba38-1074-43da-9427-ebad905d8d48", "stackTrace": [] }响应{“errorMessage”:“无法导入模块'lambda_function':没有名为'paramiko'的模块”,“errorType”:“Runtime.ImportModuleError”,“requestId”:“8c81ba38-1074-43da-9427-ebad905d8d48”,“堆栈跟踪”: [] }

Following is the file hierarchy within the upload.zip file:以下是 upload.zip 文件中的文件层次结构:

Python->lib->Python3.6->site packages Python->lib->Python3.6->站点包

The contents in the above location are also uploaded as an image.上述位置的内容也作为图像上传。

On googling another answer, I also tried moving all the contents to the super-parent folder Python, but was still unsuccessful.在谷歌搜索另一个答案时,我也尝试将所有内容移动到超级父文件夹 Python,但仍然没有成功。

Please suggest how to make it work.请建议如何使其工作。

TIA. TIA。

I finally resolved it myself.我终于自己解决了。

Turns out I was following all the steps correctly.事实证明我正确地遵循了所有步骤。 But being new to AWS, and due to the unavailability of a Linux System, I was using the Windows system, and since Amazon works with Linux in the background, there was a discrepancy.但是作为 AWS 的新手,由于 Linux 系统不可用,我使用的是 Windows 系统,并且由于亚马逊在后台使用 Linux,因此存在差异。 I made use of the EC2 instance for Linux based libraries, and resolved the issue.我为基于 Linux 的库使用了 EC2 实例,并解决了这个问题。

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

相关问题 无法删除 AWS Lambda function - Unable to Delete an AWS Lambda function 使用 Sharp 库运行 AWS Lambda 函数时出现问题 - Problem running AWS Lambda function with Sharp library 如何使用 ctypes.util.find_library 导入 AWS lambda(python)中的 so 库? - How to use ctypes.util.find_library to import .so libraries in AWS lambda (python)? 从用 Node.js 编写的 AWS Lambda 函数调用 Python boto3 库 - Call Python boto3 library from AWS Lambda function written in Node.js 如何使用 python 中的 AWS lambda function 将 excel 文件上传到 AWS S3 - How to upload excel file to AWS S3 using an AWS lambda function in python 如何从 s3 存储桶解析 CSV 以在 javascript AWS Lambda function 中使用 - How to parse CSVs from s3 bucket to use in a javascript AWS Lambda function 从 AWS lambda function 中的 s3 存储桶中读取 .mdb 或 .accdb 文件并使用 python 将其转换为 excel 或 csv - Reading .mdb or .accdb file from s3 bucket in AWS lambda function and converting it into excel or csv using python 在 python 中删除 AWS Lambda function 上的触发器 - Delete trigger on a AWS Lambda function in python 测试 aws lambda python function 嵌套 json - Testing aws lambda python function with nested json AWS Lambda - 无法导入模块“lambda_function” - AWS Lambda - unable to import module 'lambda_function'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM