0

我已经在 Linux 和 Mac 上成功编译了 pysqlite 2.7.0(2.8.1 似乎与 Python 2.7 有编译问题)并且能够使用 fts(全文搜索),但是在 Windows 上使用完全相同的编译步骤会导致pysqlite 已编译,但 fts3 和 fts4 将不起作用。

编译步骤:

  1. 签出 pysqlite
  2. 将 sqlite 算法提取到 src
  3. 提取 sqlite3.def 到 src(从预编译的 sqlite 用于 windows、linux 和 osx 不需要这个)
  4. 跑了setup.py install,也尝试了变化,例如。setup.py build_ext installsetup.py build_static install
  5. 调用 python shell 并运行以下命令:

    from pysqlite2 import dbapi2 as sqlite3
    con = sqlite3.connect(":memory:")
    con.execute("create virtual table recipe using fts3(name, ingredients)")
    

在 Linux 和 Mac 上这有效,在 Windows 上失败并显示no such module: fts3.

我在 Windows 上缺少什么额外的步骤?不幸的是,pysqlite 为构建 pysqlite 提供了零文档(或者我根本找不到它)。

更新:

我已经放弃了 pysqlite,转而使用 adsw,到目前为止,我认为没有理由为这个决定感到遗憾。

4

0 回答 0