lambgeo / docker-lambda

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

Invoking lambda always throws "No module named 'osgeo' " #59

Closed abdul-imran closed 10 months ago

abdul-imran commented 10 months ago

My lambda is is us-west-1 region & I'm using the layer arn:aws:lambda:us-west-1:524387336408:layer:gdal32-python38-geo:1 I have also created the 2 environment variables GDAL_DATA and PROJ_LIB The only thing my lambda does is importing gdal as from osgeo import gdal

When this lambda is executed, I get the below error { "errorMessage": "Unable to import module 'handler': No module named 'osgeo'",
"errorType": "Runtime.ImportModuleError", "stackTrace": [] }

I have tried using Python 7 & 8 7 still see the same error. Am I missing something? Please help me. Thanks

vincentsarago commented 10 months ago

the layer do no provide the python GDAL bindings, you need to create your own package https://github.com/lambgeo/docker-lambda#2-advanced-need-other-dependencies