In ubuntu 16.04 I cannot import gdal in Python. My code starts with:

from osgeos import gdal

but I got error:

    File "ccomt.py", line 1, in <module>
from osgeo import gdal
File "/home/neptun/miniconda2/lib/python2.7/site-packages/osgeo /__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "/home/neptun/miniconda2/lib/python2.7/site-packages/osgeo/__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description) 
ImportError: /home/neptun/miniconda2/lib/python2.7/site-packages/osgeo/_gdal.so: undefined symbol: VSISupportsSparseFiles

Does anyone faced the same problem?


Just for the record, the problem was in the libgdal version. It was downgraded from version 2.2.1-2 to version 2.1.4-2 when installing rasterio 0.36.0-py27_0 package. Reinstalling libgdal solved the problem.

conda remove libgdal
conda install -c conda-forge libgdal

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.