GeoDjango and Spatialite on Mac: issue with C extension Loading
Asked Answered
R

0

5

I'm following the GeoDjango Tutorial to set up a dev spatial DB for my project on my home machine, a Mac Mini running OSX 10.8.2. I installed the KyngChaos packages (UnixImageIO, PROJ, GEOS, SQLite3 and GDAL) and spatialite as detailed in the OSX section of the tutorial..

I created the database via spatialite, but when I try python manage.py sqlall world to check the model I get the following error:

django.core.exceptions.ImproperlyConfigured: The pysqlite library does not support C extension loading. Both SQLite and pysqlite must be configured to allow the loading of extensions to use SpatiaLite.

There's not too much out there about this problem (and especially nothing for OSX) - most solutions involve installing pysqlite without the define=SQLITE_OMIT_LOAD_EXTENSION option (e.g. here). I tried with both spatialite 2.3.1 and 2.4, I patched and installed pysqlite in my virtualenv but I always get the same problem.

Both spatialite and sqlite3 binaries seem to execute properly, and setting up a non-spatial sqlite database for django works fine too, so I doubt it's an issue with SQLite itself.

Any hints on how to get this working would be great. Thanks.

Replenish answered 15/1, 2013 at 2:8 Comment(1)
I have had much the same problem. Had no reply to my request for help on github... Maybe the pysqlite project is dead github.com/ghaering/pysqlite/issues/60 I think I will have to use Postgres instead...Lassa

© 2022 - 2024 — McMap. All rights reserved.