I'm trying to import psycopg2 into my python 3.6 lambda function but I keep running into the error message 'Unable to import module 'lambda_function': /var/task/psycopg2/_psycopg.cpython-36m-x86_64-linux-gnu.so: ELF file's phentsize not the expected size'
I'm uploading the zip file directly into the lambda function through the AWS console. I've tried using https://github.com/jkehler/awslambda-psycopg2 library but it's given me the same message.
I've been able to successfully run my script on an EC2 instance (Amazon Linux AMI 2018.03.0 (HVM)), and I've even tried uploading the EC2 instance psycopg2 library onto lambda, but I still keep getting the same error message.
Any help would be appreciated.