How To Get Gdal Version Two To Work In Google Gcloud
If you are using Gcloud, by now you must have noticed that GDAL version two, needs more work to get it working on GCloud. This is so because the version of Python generally supported by GCloud is version 3.7 of which GDAL 2.X requires Python 3.8 and above. For that reason, you will get the following error trying to run GDAL 2.X with Python 3.7:
File "/opt/python3.7/lib/python3.7/ctypes/init.py", line 377, in getattr func = self.getitem(name) File "/opt/python3.7/lib/python3.7/ctypes/init.py", line 382, in getitem func = self._FuncPtr((name_or_ordinal, self)) AttributeError: /usr/lib/libgdal.so.1: undefined symbol: OGR_F_GetFieldAsInteger64
To solve this problem is to run a custom runtime as explained here in google docs: https://cloud.google.com/appengine/docs/flexible/custom-runtimes Mainly what that means is getting your App.yaml file to run a custom runtime by creating your own docker image for deployment. It should be mentioned here too that, you'll be able to get this working on Gcloud Flex Environment or some other computer engine environment but not standard environment. That said, here is an example working app.yaml file setup:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
And finally your docker container file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|