本文介绍了GeoDjango-GDAL库给出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让GeoDjango在ubuntu上运行,并遇到了GDAL问题.

I am trying to get GeoDjango running on ubuntu and have hit a problem with GDAL.

我已经下载并安装了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文件位于:

/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.solibgdal.so.1都符号链接到libgdal.so.15.1

任何帮助将不胜感激.

推荐答案

因此,根据记录,答案是将库路径/usr/local/lib/添加到/etc/ld.so.conf,然后运行$ sudo ldconfig

So, for the record, the answer was to add the library path /usr/local/lib/ to /etc/ld.so.conf, then run $ sudo ldconfig

这篇关于GeoDjango-GDAL库给出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 13:28