Using GDAL with GeoDjango

So, just a quick solution to a simple but possibly common problem. When running through the official GeoDjango tutorial I had some problems with the GDAL library being recognized.

I did this:

    $ ogrinfo world/data/TM_WORLD_BORDERS-0.3.shp

and go this:

    $ 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

The answer, which took me a little while to find, was to add the library path, /usr/local/lib to /etc/ld.so.conf.

Then activate the path:

    $ ldconfig

Now all is fine.

Advertisements