0

I am trying to use the GDAL as a lambda layer in my AWS environment. But I am getting this error response:

"errorMessage": "Unable to import module 'lambda_function': cannot import name '_gdal' from 'osgeo' (/opt/python/osgeo/__init__.py)",
  "errorType": "Runtime.ImportModuleError",
  "stackTrace": []
}

I believe I did not install that GDAL successfully. I just used the "pip install [GDAL Wheel file] -t . " command to install using the wheel file and imported the generated file to my lambda layer.

I did that because I'm having a problem running the command "pip install gdal" it says "Running setup.py install for GDAL did not run successfully."

Now, my question is, is there any way I can import gdal as layer in my AWS environment using python?

cownan_kun
  • 386
  • 3
  • 8
  • You can use lambda containers and bundle all dependencies that you want in your docker image. – Marcin Jan 13 '23 at 09:32
  • [This answer to a related question](https://stackoverflow.com/a/61505499/5997555) might be helpful – Val Jan 16 '23 at 19:23

0 Answers0