user8112786
user8112786

Reputation: 38

Using SQLAlchemy in AWS LAMBDA

I am trying to use SQL Alchemy in AWS Lambda function but it is throwing error:

module not found.

Also I am attaching the folder structure which I am deploying to Lambda layer after zipping.

I am using the following command to create the folder for lambda layer.

pip3 install sqlalchemy --target Alchemy_layer/

enter image description here

Upvotes: 0

Views: 5918

Answers (1)

Jens
Jens

Reputation: 21530

The layer needs a different folder structure according to the documentation.

Try this:

pip3 install sqlalchemy --target python/
zip -r sqlalchemy-layer.zip python/

Upload that ZIP as layer and try again.

Upvotes: 3

Related Questions