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?

styfle
  • 22,361
  • 27
  • 86
  • 128
Naveen
  • 5,910
  • 5
  • 30
  • 38
  • 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. – MrValdez Dec 26 '10 at 05:06

4 Answers4

17
  1. Download the latest sql dll.

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

MrValdez
  • 8,515
  • 10
  • 56
  • 79
  • @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. – MrValdez Dec 15 '11 at 04:41
  • @MrValdez: Should I edit it or the person who asked the question? And should I just edit the title or what? – styfle Dec 15 '11 at 04:44
  • @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). – MrValdez Dec 16 '11 at 22:21
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.
Naveen
  • 5,910
  • 5
  • 30
  • 38
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.

varun
  • 4,522
  • 33
  • 28
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.

Dibakar
  • 139
  • 4
  • 15