如何在 Windows 上使用 python2.7 设置 FTS3/FTS4

发布于 2024-09-25 21:41:37 字数 196 浏览 4 评论 0原文

默认情况下,FTS3/FTS4 在 python 中不起作用(最高 2.7)。我收到错误:

sqlite3.OperationalError: no such module: fts3
or

sqlite3.OperationalError: no such module: fts4

如何解决这个问题?

FTS3/FTS4 doesn't work in python by default (up to 2.7). I get the error:

sqlite3.OperationalError: no such module: fts3

or

sqlite3.OperationalError: no such module: fts4

How can this be resolved?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

岁月染过的梦 2024-10-02 21:41:37
  1. 下载最新的sql dll

  2. 替换 python/dll 文件夹中的 sqlite.dll。

  1. Download the latest sql dll.

  2. Replace sqlite.dll in your python/dll folder.

醉殇 2024-10-02 21:41:37

没关系。
从源代码安装 pysqlite 非常简单且足够。

python setup.py build_static install 

fts3 is enabled by default when installing from source.

never mind.
installing pysqlite from source was easy and sufficient.

python setup.py build_static install 

fts3 is enabled by default when installing from source.

节枝 2024-10-02 21:41:37

纳文所说的但是=>

对于 Windows 安装:

在运行 setup.py 进行包安装时...Python 2.7 搜索已安装的 Visual Studio 2008。您可以通过设置欺骗 Python 使用 Visual Studio

设置 VS90COMNTOOLS=%VS100COMNTOOLS%

What Naveen said but =>

For Windows installations:

While running setup.py for for package installations... Python 2.7 searches for an installed Visual Studio 2008. You can trick Python to use Visual Studio by setting

SET VS90COMNTOOLS=%VS100COMNTOOLS%

before calling setup.py.

靑春怀旧 2024-10-02 21:41:37

我的回答与Python 2.7无关。但希望它对使用 Python 3.5 的用户有所帮助。我正在使用 sqlite 全文搜索工具。然而,当我尝试插入 FTS3 虚拟表时,

def insertdata(conn, parmvlu):

    sql = ''' INSERT INTO slangs(slang,polarity)
              VALUES(?,?) '''
    cur = conn.cursor()
    cur.execute(sql, parmvlu)
    return cur.lastrowid

我收到错误 -

sqlite3.OperationalError: no such module: fts3

FTS4 虚拟表也出现类似错误。从网站获取提示
,我从 此处 下载并复制了 Windows 的 sqlite 预编译二进制文件到我的 Python DLL 目录中(我备份了原始的sqlite.dll)。我的 Python 应用程序开始正常工作。

My answer is not related to Python 2.7. But hope it becomes helpful for users using Python 3.5. I was using sqlite Fulltext search facility. However when I was trying to Insert into a FTS3 Virtual table

def insertdata(conn, parmvlu):

    sql = ''' INSERT INTO slangs(slang,polarity)
              VALUES(?,?) '''
    cur = conn.cursor()
    cur.execute(sql, parmvlu)
    return cur.lastrowid

I was getting an error -

sqlite3.OperationalError: no such module: fts3

Similarly error was coming for FTS4 Virtual tables. Taking cue from the site
, I downloaded and copied the sqlite precompiled Binaries for Windows from here into my Python DLL directory (I backed up the original sqlite.dll). My Python application started working fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文