Error Message - No module named psycopg2
File used in zip - https://github.com/jkehler/awslambda-psycopg2
Code Snippet -
#!/usr/bin/python
import psycopg2
import sys
import pprint
import datetime
def lambda_handler(event, context):
#Connect to RedShift
conn_string = "dbname='XXXX' port='5439' user='XXX' password='XXXX' host='XXXXXXXXXXXX'";
conn = psycopg2.connect(conn_string);
cursor = conn.cursor();
cursor.execute("begin transaction");
cursor.execute("truncate table XXXX");
cursor.execute("truncate table XXXX");
cursor.execute("truncate table XXXX");
cursor.execute("delete from XXXX");
cursor.execute("insert into XXXX");
cursor.execute("truncate table XXXX");
cursor.execute("truncate table XXXX");
cursor.execute("truncate table XXXX");
cursor.execute("end transaction");
conn.commit();
conn.close();
Extracted and Copied psycopg2 in windows into my AWS Lambda zip package along-with my python file and site packages.
Did I miss anything?
EDIT
Recreated the package with zipping the file on Amazon Linux. Still same error.