I am trying to get GeoDjango running on ubuntu and have hit a problem with GDAL.
I have downloaded and installed GDAL without problem.
I had to add the following line to my project settings:
GDAL_LIBRARY_PATH = '/usr/local/lib/libgdal.so.1.15.1'
When I check in the shell all is good:
In [1]: from django.contrib.gis import gdal
In [2]: gdal.HAS_GDAL
Out[2]: True
However when I try and run ogrinfo as in the official tutorial I get the following error:
$ ogrinfo world/data/TM_WORLD_BORDERS-0.3.shp
ogrinfo: error while loading shared libraries: libgdal.so.1: cannot open shared object file: No such file or directory
GDAL files are located at:
/usr/local/lib/libgdal.a
/usr/local/lib/libgdal.la
/usr/local/lib/libgdal.so
/usr/local/lib/libgdal.so.1
/usr/local/lib/libgdal.so.1.15.1
libgdal.so
and libgdal.so.1
both symlink to libgdal.so.15.1
Any help would be much appreciated.
So, for the record, the answer was to add the library path /usr/local/lib/
to /etc/ld.so.conf
, then run $ sudo ldconfig
sudo ldconfig
Often is all you need. Just check /etc/ld.so.conf
before you start adding paths, /usr/local/lib
may already be listed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With