Python GDAL installation by pip fails

2.9k views Asked by At

I tried to install python GDAL via pip but getting the following error:

extensions/gdal_wrap.cpp:4265:47: error: use of undeclared identifier 'GDALDatasetCreateLayer'; did you mean 'GDALDatasetShadow_CreateLayer'? OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetCreateLayer( self, GDALDatasetShadow_CreateLayer

I guessed the reason is the mismatched version of GDAL library, so tried this:

$ brew unlink gdal
$ brew install gdal
$ gdalinfo --version
GDAL 1.11.1, released 2014/09/24

But, still getting the error.

Do I need to install an older version of python GDAL? If so, please let me know which version.

Thanks.

1

There are 1 answers

1
kert On

As of today, brew has

gdalinfo --version GDAL 1.11.2, released 2015/02/10

Thus, pip install GDAL==1.11.2

Goes just fine. Pypi has 2.0.0 available