I am trying to run an AWS Lambda function and I need pyodbc as a library. When importing pyodbc, I am getting the error:
Unable to import module 'lambda_function': /var/task/lib/libodbc.so.2: file too short.
I cannot find much on this error. Has anyone else experienced this / have advice on how to get past it?
So far, I have:
Spun up an EC2 instance and created a deployment package using a combination of these instructions here: https://gist.github.com/diriver63/b72a954fa0da4851d89e5086aa13c6e8 and here: https://www.youtube.com/watch?v=xWbU_OnkFOo. If I do not spin up an EC2 instance and package what I need with Linux, I get the error - "[unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found (0) (SQLDriverConnect)\").
I have ensured all my files are zipped individually rather than zipping a whole folder (if a entire folder is zipped I get a "cannot find lamdba_function" error)
Flattened out my file structure so all files are in the home drive, except those that were in lib and lib64 folders. If they are in separate folders, I get a different error - "Unable to import module 'lambda_function': No module named 'pyodbc'" OR "[01000] [unixODBC][Driver Manager]Can't open lib '\libodbc.so'"See current file structure