【问题标题】:Using SpatiaLite with web2py?将 SpatiaLite 与 web2py 一起使用?
【发布时间】:2015-09-06 02:15:45
【问题描述】:

正如this post 中所述,我一直在尝试使用 web2py 数据库抽象层的 SpatiaLite 适配器,但我收到了“RuntimeError:连接失败,尝试了 5 次”消息。

我已将 SpatiaLite DLL 安装到 Windows 的 /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 一起工作的任何建议?

【问题讨论】:

  • 您是从源代码运行 web2py 还是使用 Windows 二进制版本?
  • @Anthony - 我正在运行 web2py 的源代码版本,而不是 Windows 二进制版本。

标签: python web2py spatialite


【解决方案1】:

在 Windows 上,您似乎必须将 rename the DLL 转换为 libspatialite.dll

【讨论】:

  • 注意,issue filed 要求取消名称更改要求。
  • 是的,这就解决了。谢谢
猜你喜欢
  • 1970-01-01
  • 2013-12-23
  • 2012-08-20
  • 2011-08-28
  • 1970-01-01
  • 1970-01-01
  • 2016-06-22
  • 2012-04-03
  • 1970-01-01
相关资源
最近更新 更多