developmentseed / geolambda

Create and deploy Geospatial AWS Lambda functions
MIT License
303 stars 85 forks source link

Basic usage failure? #93

Closed ramotswa closed 3 years ago

ramotswa commented 4 years ago

Hello all, So I did what I thought would be the simplest test ever.

  1. Created python lambda in eu-central-1
  2. Added the layer via ARN for the latest for that region
  3. Set the env vars.
  4. Literally just put an 'from osgeo import gdal' into the default python lambda code.
  5. Tested it.

I get 'Unable to import module ..: No module named osgeo'

Should that work?

Many thanks

franchyze923 commented 3 years ago

@ramotswa I've also tried setting up a simple test like yours but get the error: "No module named '_gdal'" I'm wondering if we are missing a step? I've added 2 layers -

arn:aws:lambda:us-east-1:552188055668:layer:geolambda:4 arn:aws:lambda:us-east-1:552188055668:layer:geolambda-python:3

@matthewhanson Should @ramotswa workflow work? Or are we missing an important step? I'd like to get confirmation that this workflow should work. If this is a valid workflow, perhaps I've misconfigured my lambda function.

Thanks for any help - really eager to get this working.

image

image

franchyze923 commented 3 years ago

@ramotswa What version of Python are you using? I was using 3.6 and switched to 3.7 and it works now. I tried 3.8 and 2.7 out of curiosity and they also didn't work, so I guess these layers are targeted for 3.7 python runtime.

image

ramotswa commented 3 years ago

Interesting - I'm sure I was using 2.7 so that might explain it. Thanks for the tests.

On Wed, 30 Sep 2020 at 12:23, Fran Polignano notifications@github.com wrote:

@ramotswa https://github.com/ramotswa What version of Python are you using? I was using 3.6 and switched to 3.7 and it works now. I tried 3.8 and 2.7 out of curiosity and they also didn't work, so I guess this are layers are targeted for 3.7 python runtime.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/developmentseed/geolambda/issues/93#issuecomment-701328979, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF6CIK6FFX2TWOZM65DOLDSIMILJANCNFSM4P57M2XA .

matthewhanson commented 3 years ago

Has this been resolved? The Python GeoLambda is Python 3.7. I tried this out with Python 3.8 and confirmed it fails with that error message.

Working on some updates and will try to generate layers for multiple Python versions.

franchyze923 commented 3 years ago

Resolved as far as I'm concerned. Looking forward to multiple versions of python supported. Thanks