GeoDjango and Spatialite on Mac: issue with C extension Loading

大兔子大兔子 提交于 2019-12-22 09:42:36

问题


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.

来源:https://stackoverflow.com/questions/14330102/geodjango-and-spatialite-on-mac-issue-with-c-extension-loading

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!