'AWS Lambda issue with PostgreSQL - No module named 'psycopg2' - Uploading package from Windows

I'm trying to create a layer and use it in Lambda function for PostgreSQL but getting the issue:

"errorMessage": "Unable to import module 'lambda_function': No module named 'psycopg2'", "errorType": "Runtime.ImportModuleError"

I've tried uploading the Psycopg2 package from https://github.com/jkehler/awslambda-psycopg2 but still no progress. I've tried every version from 3.6 to 3.9. I'm using Windows OS.

What is the simplest way or the best solution for it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source