[英]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.