I’m building my first GeoDjango project but I’m kinda desperate.
I’v installed PostgreSQL 9 and PostGis 1.5 through one-click installer on Windows. So everthing is there. I set GEOS_LIBRARY_PATH to the full path of libgeos_c-1.dll in settings.py. But when I run manage.py syncdb, I encounter the following errors:
File "C:\Python25\lib\site-packages\django\contrib\gis\geometry\backend\geos.py", line 1, in <module>
from django.contrib.gis.geos import \
File "C:\Python25\Lib\site-packages\django\contrib\gis\geos\__init__.py", line 6, in <module>
from django.contrib.gis.geos.geometry import GEOSGeometry, wkt_regex, hex_regex
File "C:\Python25\Lib\site-packages\django\contrib\gis\geos\geometry.py", line 14, in <module>
from django.contrib.gis.geos.coordseq import GEOSCoordSeq
File "C:\Python25\Lib\site-packages\django\contrib\gis\geos\coordseq.py", line 9, in <module>
from django.contrib.gis.geos.libgeos import CS_PTR
File "C:\Python25\lib\site-packages\django\contrib\gis\geos\libgeos.py", line 51, in <module>
lgeos = CDLL(lib_path)
File "C:\Python25\lib\ctypes\__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
So I open libgeos.py and check the line specified. It’s just a simple “CDLL(lib_path)”. Apparently lib_path is GEOS_LIBRARY_PATH.
So I create a simple test:
from ctypes import CDLL
lgeos = CDLL('libgeo's path')
Still have the same problem. So it’s simply not able to use CDLL to load this dll at all with python. At this stage, I don’t know what to do. Please help.
Same issue here. Could you maybe be so kind as to share the correct DLL? If that indeed solves the problem. Or is installing OSGeo4W the only way?If so what installation procedure did you follow?