Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GeoDjango can't find geos library

When attempting to fire up the django server, I get the following error:

django.core.exceptions.ImproperlyConfigured: Could not import user-defined GEOMETRY_BACKEND "geos".

I'm running postgresql8.4 on Mac OS Lion.

I've used Macports to install PostGIS. Here's what $ port installed shows:

postgis @1.5.2_1+postgresql84 postgis @1.5.2_1+postgresql90 postgis @1.5.3_0+postgresql90 postgis @1.5.3_0+postgresql91 (active)

Here's what I get when attempting to determine what version of PostGIS I've got:

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
like image 929
wmfox3 Avatar asked Nov 28 '11 00:11

wmfox3


People also ask

How do you set up GeoDjango?

First, download the OSGeo4W installer (64bit), and run it. Select Express Web-GIS Install and click next. In the 'Select Packages' list, ensure that GDAL is selected; MapServer is also enabled by default, but is not required by GeoDjango and may be unchecked safely.

What is GeoDjango?

GeoDjango is an included contrib module for Django that turns it into a world-class geographic web framework. GeoDjango strives to make it as simple as possible to create geographic web applications, like location-based services. Its features include: Django model fields for OGC geometries and raster data.

What is Gdal Django?

GDAL stands for Geospatial Data Abstraction Library, and is a veritable “Swiss army knife” of GIS data functionality. A subset of GDAL is the OGR Simple Features Library, which specializes in reading and writing vector geographic data in a variety of standard formats.


1 Answers

Just in case some developers are facing this problem on Ubuntu, I solved it just installing libgeos-lib

sudo apt-get install libgeos-dev

like image 117
panchicore Avatar answered Sep 18 '22 18:09

panchicore