I installed the GDAL library on Ubuntu 14.04 through the Anaconda (Python 3.5) distribution. After installation, which seems to work fine, I try importing it and I get this error:
>>>from osgeo import gdal
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/klab/anaconda3/lib/python3.5/site-packages/osgeo/__init__.py", line 21, in <module> _gdal = swig_import_helper()
File "/home/klab/anaconda3/lib/python3.5/site packages/osgeo/__init__.py", line 17, in swig_import_helper_mod = imp.load_module('_gdal', fp, pathname, description)
File "/home/klab/anaconda3/lib/python3.5/imp.py", line 242, in load_module return load_dynamic(name, filename, file)
File "/home/klab/anaconda3/lib/python3.5/imp.py", line 342, in load_dynamic return _load(spec)
ImportError: libcom_err.so.3: cannot open shared object file: No such file or directory
I tried installing through PIP and Conda install commands with the same error. I did go to the directory where this should exist, and it indeed is missing. I figured that if this were a true dependency, it would have installed automatically. Has anybody else had this problem?
I was trying to follow this link, but it wasn't helpful. https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/2-bXTbSiQzg
Best Answer
I also installed the GDAL library, but on Debian Jessie, through the Anaconda (Python 3.5) distribution. In my case, I got the following error which pointed out to a missing libexpat.so.0 file or directory (different of your libcom_err.so.3):
I solved my issue by creating a symbolic link named libexpat.so.0 pointing to libexpat.so in this way:
as it can be observed at the next image after importing GDAL module:
In your case, try out:
I hope that it works.