在Ubuntu 16.04上尝试在PostgreSQL上启用PostGIS时出现GDAL错误

时间:2017-01-30 14:53:19

标签: django postgresql ubuntu postgis gdal

为了在我的Django项目上启用地理数据,我试图在我的Ubuntu 16.04盒子上启用GeoDjango扩展。

PostGIS和GDAL显然是必需的,似乎并不能很好地结合在一起。 在psql shell中,运行以下命令时:

CREATE EXTENSION postgis;

我收到此错误:

ERROR:  could not load library "/usr/lib/postgresql/9.5/lib/rtpostgis-2.2.so": /usr/lib/libgdal.so.1: undefined symbol: sqlite3_column_table_name

这个错误在Django和Python用户中似乎很熟悉,并且解决方案需要修复virtualenv。但这种情况纯粹来自数据库,没有涉及到Python。 sqlite3版本冲突似乎也是一个常见的陷阱,即使我在这种情况下无法追踪此类问题。

另外,我已经检查了库文件是否有符号,并且它发现是这种情况:

nm -D /usr/lib/libgdal.so.1 | grep sqlite3_column
                 U sqlite3_column_blob
                 U sqlite3_column_bytes
                 U sqlite3_column_count
                 U sqlite3_column_decltype
                 U sqlite3_column_double
                 U sqlite3_column_int
                 U sqlite3_column_int64
                 U sqlite3_column_name
                 U sqlite3_column_table_name
                 U sqlite3_column_text
                 U sqlite3_column_type

在库中找到sqlite3_column_table_name符号,错误消息则相反。

如何修复环境以使PostGIS运行?

0 个答案:

没有答案