How can I import Psycopg2 into a Lambda Function on AWS?
I am trying to import the Psycopg2 library into a Lambda Function, but every time it continues to fail, I have tried pip installing the library then zipping it with the .py file, it fails… with “”Unable to import module ‘lambda_function’: No module named ‘psycopg2._psycopg'”. Then I tried to use Docker and create a container to identical to the runtime of lambda, and it failed with the same error message. I even tried to create my own layer and it still continues to fail, here is the code for importing and getting a connection (which it never makes it too):