10

I'm starting a GeoDjango project using Python 2.5, Django 1.2, MySQL and Apache. The project will be uploaded to a Linux server but the development will be on a Windows.

The problem is I just can't get passed installing GEOS, how is it done?

Siavash
  • 358
  • 1
  • 5
  • 19

3 Answers3

7

I follow the instructions in

http://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#windows

For the instalation of GEOS library in windows i use this:

http://trac.osgeo.org/osgeo4w/

diegueus9
  • 29,351
  • 16
  • 62
  • 74
  • I've already tried using the installer. I get an error at : `from django.contrib.gis.db import models`. The error is : `ImportError: Could not find the GEOS library (tried "geos_c"). Try setting GEOS_LIBRARY_PATH in your settings` so I set the GEOS_LIBRARY_PATH to where i installed GeoDjango in `D:\Python25\Lib\site-packages\GeoDjango` now I get `The specified module cannot be found` – Siavash Mar 05 '11 at 11:13
  • 1
    put the dll in your project directory and GEOS_LIBRARY_PATH in the settings. – diegueus9 Mar 07 '11 at 13:42
  • Could it be because I'm using Python 2.5? Django doucumentation indicates it should be 2.7 – Siavash Mar 26 '11 at 05:35
  • i dont think so. i was using python 2.5 – diegueus9 Mar 26 '11 at 08:59
4

what I did is to install GDAL from this answer, Unable to install Python and GDAL (DLL load failed), and then add this line to settings.py,

GEOS_LIBRARY_PATH = 'C:/Program Files/GDAL/geos_c.dll'

then it is fine to use postgis.

Community
  • 1
  • 1
TonyTony
  • 1,344
  • 15
  • 23
  • No idea why but this is the only solution that worked for me after searching the whole Stack Overflow! With `geos_c.dll` in the `GEOS_LIBRARY_PATH` (I have `GEOS_LIBRARY_PATH = C:\OSGeo4W64\bin\geos_c.dll`). Thank you. – user2314737 Dec 07 '15 at 17:51
1

Follow this tutorial it will Install GDAL complete library including GEOS. Just did it yesterday worked fine

http://www.gis.usu.edu/~chrisg/python/2009/docs/gdal_win.pdf

Jorge Vidinha
  • 404
  • 7
  • 20