正如在这个职位中解释的那样,我一直试图使用web2py数据库抽象层的SpatiaLite适配器,并且我收到了一条"RuntimeError:未能连接,尝试了5次“的消息。
我已经将SpatiaLite DLL安装到/System32文件夹中,并且能够执行以下操作:
import sqlite3
conn = sqlite3.connect(":memory:")
conn.enable_load_extension(True)
conn.execute('SELECT load_extension("libspatialite-2.dll")')
SpatiaLite version ..: 2.2 Supported Extensions:
- 'VirtualShape' [direct Shapefile access]
- 'VirtualText' [direct CSV/TXT access]
- 'RTree' [Spatial Index - R*Tree]
- 'MbrCache' [Spatial Index - MBR cache]
- 'SpatiaLite' [Spatial SQL - OGC]
PROJ.4 Rel. 4.6.1, 21 August 2008
GEOS version 3.0.0-CAPI-1.4.1
<sqlite3.Cursor object at 0x0202B360>因此,我的python安装似乎可以使用SpatiaLite。但是,SpatiaLite DLL的存在似乎无法解决web2py“连接失败”错误。对于如何让SpatiaLite与web2py协同工作,有什么建议吗?
发布于 2015-09-07 13:53:09
在Windows上,看起来您必须从重命名DLL到libspatialite.dll。
https://stackoverflow.com/questions/32419389
复制相似问题