尝试启动 django 服务器时,出现以下错误:
django.core.exceptions.ImproperlyConfigured: Could not import user-defined GEOMETRY_BACKEND "geos".
我在 Mac OS Lion 上运行 postgresql8.4。
我使用 Macports 安装 PostGIS。这是 $ port installed 显示的内容:
postgis @1.5.2_1+postgresql84 postgis @1.5.2_1+postgresql90 postgis @1.5.3_0+postgresql90 postgis @1.5.3_0+postgresql91(活跃)
这是我在尝试确定我拥有的 PostGIS 版本时得到的结果:
geodjango=# SELECT PostGIS_full_version();
ERROR: could not access file "$libdir/postgis-1.5": No such file or directory
CONTEXT: SQL statement "SELECT postgis_lib_version()"
PL/pgSQL function "postgis_full_version" line 11 at SQL statement
最佳答案
为了防止一些开发人员在 Ubuntu 上遇到这个问题,我只安装了 libgeos-lib 就解决了这个问题
sudo apt-get install libgeos-dev
关于django - GeoDjango 找不到 geos 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8290167/