lambgeo / docker-lambda

AWS Lambda friendly GDAL Docker images and AWS Lambda layer
MIT License
121 stars 17 forks source link

Trouble using lambda layers (python 3.9 / gdal 3.5) #49

Closed bo-lu closed 2 years ago

bo-lu commented 2 years ago

Not quite sure what I'm missing when trying to use that the layer arn: arn:aws:lambda:ca-central-1:524387336408:layer:gdal35:3 on ca-central-1 based on this list

I tried to import numpy and rasterio which both failed as well. Finally, if I add the aws-data-wrangler layer, I am able to import numpy without error.

gdal-layer
vincentsarago commented 2 years ago

The GDAL35 layer has no python module, just GDAL C libraries. You need to create your own runtime layer/package using https://github.com/lambgeo/docker-lambda#2-advanced-need-other-dependencies

bo-lu commented 2 years ago

I took at the GDAL35 layer and it doesn't look like it was installed with the python bindings to support from osgeo import gdal anyway. Is that correct?

vincentsarago commented 2 years ago

The GDAL35 layer has no python module, just GDAL C libraries.