1

AWS lambda is able to find my function in handler settings and certain libraries I have installed in the root folder, but is unable to find other libraries like pyodbc and google.cloud.storage.

Error: START RequestId: 607f59cb-44a9-11e7-82c2-813a7578fcd0 Version: $LATEST Unable to import module 'push_to_s3': No module named pyodbc

3
  • Is there a pyodbc packaged with your Labda? Can you show us an overview of the Lambda packaging? Commented May 29, 2017 at 20:20
  • @stdunbar yes, i just ran 'pip install pyodbc -t .' in the folder I zipped and it added both the pyodbc.pyd file and the pyodbc-4.0.16.dist-info folder Commented May 29, 2017 at 20:24
  • stackoverflow.com/a/64327675/2506172 should be relevant here. Commented Oct 13, 2020 at 2:41

1 Answer 1

1

You might need to pre-compile the pyodbc lib using the specific AMI Lambda uses (AMI name: amzn-ami-hvm-2016.03.3.x86_64-gp2).

Here the install instructions on Linux:

https://learn.microsoft.com/en-us/sql/connect/python/pyodbc/step-1-configure-development-environment-for-pyodbc-python-development

Here are more details about native libraries on Lambda env.:

http://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html

Here some other things you might consider while creating your deployment packages:

http://joarleymoraes.com/hassle-free-python-lambda-deployment/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.