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

Question:

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:

Response { "errorMessage": "Unable to import module
‘lambda_function’: No module named ‘paramiko’", "errorType":
"Runtime.ImportModuleError", "requestId":
"8c81ba38-1074-43da-9427-ebad905d8d48", "stackTrace": [] }

Following is the file hierarchy within the upload .zip file:

Python->lib->Python3.6->site packages

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.

Please suggest how to make it work.

TIA.

Asked By: Ruchir Saxena

||

Answers:

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. I made use of the EC2 instance for Linux based libraries, and resolved the issue.

Answered By: Ruchir Saxena