I installed gdal from source using steps from this answer https://gis.stackexchange.com/a/21739/60378 (ommiting first line sudo apt-get install build-essential python-all-dev as it did not work for me). Everything went without errors. When i try to import osego or gdal it gives me error: undefined symbol: GDALSetRasterUnitType

    >>> import gdal
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/GDAL-1.9.0-py2.7-linux-x86_64.egg/gdal.py", line 2, in <module>
    from osgeo.gdal import deprecation_warn
  File "/usr/lib64/python2.7/site-packages/GDAL-1.9.0-py2.7-linux-x86_64.egg/osgeo/__init__.py", line 21, in <module>
    _gdal = swig_import_helper()
  File "/usr/lib64/python2.7/site-packages/GDAL-1.9.0-py2.7-linux-x86_64.egg/osgeo/__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: /usr/lib64/python2.7/site-packages/GDAL-1.9.0-py2.7-linux-x86_64.egg/osgeo/_gdal.so: undefined symbol: GDALSetRasterUnitType

Server is using fedora core 14, which I cannot upgrade right now. What could be wrong? Is there any simpler gdal installation method?

  • Is there a particular reason you are building version 1.9.0 instead of the recent stable release? What was the output of make and install? Alternatives are for instance the precompiled Fedora GDAL package or conda, which comes with it's own Python binary package manager, which also contains GDAL. – Kersten Oct 14 '15 at 15:43
  • No, there is no particular reason for 1.9.0. Output of make and install didn't seem to have errors. Thanks for package links, I'll try this later, as I am quite new in fedora packages, using Ubuntu mostly. Before installing should I remove previously installed GDAL? – kazik Oct 14 '15 at 18:37
  • 1
    Have you had a look see at this? gis.stackexchange.com/questions/16515/… – Hairy Oct 19 '15 at 9:03

I had similar problem and I solved this problem by downgrading of GDAL. I had GDAL 2.2.3 and I downgrade it to version GDAL 2.1.0.

You can install it with:

pip install GDAL==2.1.0

or only for user:

pip install --user GDAL==2.1.0

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.