Skip to content

How do I get "from osgeo import gdal" working? #82

Answered by 23ccozad
23ccozad asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for sharing @mirouml, your approach is very similar. I just ended up figuring out what I was missing. The Lambda layer expects dependencies to be located in \python within the zip file, according to this AWS documentation.

So I changed the structure of my zip file from:

package.zip
  |___ bin/
  |___ GDAL-3.8.3.dist-info/
  |___ osgeo/
  |___ osgeo_utils/

to

package.zip
  |___ python/
      |___ bin/
      |___ GDAL-3.8.3.dist-info/
      |___ osgeo/
      |___ osgeo_utils/

Now, I can import osgeo and gdal without any problems. Hopefully, this discussion can help others get gdal working in their Lambda functions as well. Thanks!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by 23ccozad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants