I'm trying to install GDAL for python 3.6.9 under Ubuntu 18.04 following the way at: https://pypi.org/project/GDAL/ I tried these two ways: 'easy_install' '''sudo easy_install GDAL''' and the 'setup.py' '''python setup.py build &&python setup.py install'''.

But they're all failed. Here is the information back to me when I use '''sudo easy_install GDAL''':

extensions/gdal_wrap.cpp:3209:9: error: ‘GDALExtendedDataTypeHS’ does not name a type; did you mean ‘GDALFindDataType’? typedef GDALExtendedDataTypeHS GDALExtendedDataTypeHS; ^~~~~~~~~~~~~~~~~~~~~~ GDALFindDataType


extensions/gdal_array_wrap.cpp:5771:51: error: expected ‘(’ before ‘*’ token extensions/gdal_array_wrap.cpp:5771:53: error: expected primary-expression before ‘>’ token arg8 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp8); ^ extensions/gdal_array_wrap.cpp:5771:61: error: expected ‘)’ before ‘;’ token arg8 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp8); ^

error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

How can I install the GDAL properly?

  • Please do not invent your own Markdown!
    – N0rbert
    Aug 9, 2020 at 11:23

1 Answer 1


You can install GDAL with Python binding from the repository using:

sudo apt-get install python3-gdal python-gdal libgdal-dev
  • Thaks, this works for me in some extent.
    – bowen
    Aug 11, 2020 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.