How to setup FTS3/FTS4 with python2.7 on Windows
Asked Answered
E

4

13

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?

Expressionism answered 29/9, 2010 at 16:22 Comment(1)
I found this on google and your suggestion to replace sqlite.dll in the python/dll folder worked in my case. I'm adding an answer for that in case someone else finds this problem.Rivarivage
R
17
  1. Download the latest sql dll.

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

Rivarivage answered 26/12, 2010 at 5:9 Comment(3)
@styfle, if this answer works for FTS4 as well, can you edit the question to reflect this? It'll be helpful for future people. Thanks.Rivarivage
@MrValdez: Should I edit it or the person who asked the question? And should I just edit the title or what?Behling
@styfle, the question title and the question, please. The idea is to make the question helpful to more people and also to make it easier to find via search. The person who asked wouldn't see your comment (since you posted it here).Rivarivage
E
2

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.
Expressionism answered 29/9, 2010 at 22:39 Comment(0)
A
0

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.

Arachnid answered 11/9, 2012 at 14:36 Comment(0)
K
0

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.

Keelboat answered 20/5, 2017 at 14:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.