我试图让Django的SQLite3接受空间查询。This tutorial建议我将此添加到设置中:
SPATIALITE_LIBRARY_PATH = 'mod_spatialite'
从而产生以下错误:
django.core.exceptions.ImproperlyConfigured: Unable to load the SpatiaLite library extension "mod_spatialite" because: The specified module could not be found.
我也试过这样做:
^{pr2}$如果不添加此变量,则在迁移时收到以下错误:
django.core.exceptions.ImproperlyConfigured: Unable to locate the SpatiaLite library. Make sure it is in your library path, or set SPATIALITE_LIBRARY_PATH in your settings.
谢谢。。在
以下是如何在virtualenv for Python3中安装SpatiaLite(几乎):
mod_spatialite-[version]-win-x86.7z
Scripts
文件夹中。在这一部分我不喜欢,但我不能找到一个可行的解决方案,如果不触及主要的Python3安装。在
c:\Python35\DLLs\sqlite3.dll
cyqlite
uznipsqlite3.dll
文件到c:\Python35\DLLs\
荣誉:https://gis.stackexchange.com/a/169979/84121
有趣的是,5天后我也有同样的问题。经过一番闲逛之后,我开始工作了:
设置
并将mod嫒spatialite-x.x.x-win-x86.7z中的所有DLL文件解压到Python安装目录中。dll显然需要与python.exe. 另外,根据python的安装情况,mod峎uspatialite包需要32/64位。如果丢失了一些dll,不管丢失了什么dll文件,都会得到相同的错误“specified module not found”,因此这有点误导性。在
从http://www.gaia-gis.it/gaia-sins/下载
我在python3.5.232位中使用了mod嫒spacealite稳定版本4.3.0ax86。在
关于同一问题的其他线索有各种各样的答案:
在Ubuntu18.04上, 添加
SPATIALITE_LIBRARY_PATH = 'mod_spatialite.so'
安装了libsqlite3-mod-spatialite
对我很有用。在注意:答案是}起作用。在
mod_spatialite
,而对我来说{相关问题 更多 >
编程相关推荐