Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error while uploading python zip file with psycopg2 to aws lambda

I'm trying to add the python zip files to was lambda which contains psycopg2 files in it.I'm getting an error. please try to help

  "errorMessage": "Unable to import module 'handler': libpq.so.5: cannot open shared object file: No such file or directory",
  "errorType": "Runtime.ImportModuleError"
like image 960
Akshay Jain Avatar asked Jan 19 '26 00:01

Akshay Jain


1 Answers

The point is psycopg2 depends on native code (libpq.so) and your zip file does not contain this dependency.

See here for a solution

Another option is pip install psycopg2-binary. See here for details.

like image 133
balderman Avatar answered Jan 23 '26 08:01

balderman