Je construis mon premier projet GeoDjango mais je suis un peu désespéré.libgeos_c-1.dll ne peut pas être chargé par Python
Jev a installé PostgreSQL 9 et PostGis 1.5 en installant un clic sur Windows. Donc, tout est là. J'ai mis GEOS_LIBRARY_PATH au chemin complet de libgeos_c-1.dll dans settings.py. Mais quand je lance syncdb manage.py, je rencontre les erreurs suivantes:
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
J'ouvre libgeos.py et vérifier la ligne spécifiée. C'est juste un simple "CDLL (lib_path)". Apparemment, lib_path est GEOS_LIBRARY_PATH.
Je crée donc un test simple:
from ctypes import CDLL
lgeos = CDLL('libgeo's path')
ont toujours le même problème. Il n'est donc tout simplement pas possible d'utiliser CDLL pour charger cette DLL du tout avec python. À ce stade, je ne sais pas quoi faire. S'il vous plaît aider.
Résolus en saisissant la librairie libgeos du site spatialite et en décompressant les deux dll en system32. –
Peut-être que c'est une autre solution. Je suppose que la dernière version de libgeo sur Windows a un problème? –
Je viens d'installer OSGeo4W et l'ai résolu. –