简体   繁体   中英

OperationalError: no such module: fts4

Hi I´ve tried to run a fuzzymatcher code and the error below pops up:

OperationalError: no such module: fts4

Any suggestions? Thanks in advance

Edit: I've already tried downloading the sqlite zip from the website and saving it in DLLs files but it still does not work. Do I have to activate it somehow?

I´m using Anaconda3 64 bit.

Thanks

  1. Confirm that the DLL files have been added in the correct place; if you are using Windows it will be C:\ProgramData\Anaconda3\DLLs .

  2. you can try to load the extensions:

import sqlite3
conn = sqlite3.connect(':memory:')
cur = conn.cursor()
conn.enable_load_extension(True)

for (val,) in cur.execute('pragma compile_options'): 
    print (val)

It will show some results similar to these:

COMPILER=msvc-1500
ENABLE_BYTECODE_VTAB
ENABLE_COLUMN_METADATA
ENABLE_DBSTAT_VTAB
ENABLE_FTS3
ENABLE_FTS4
ENABLE_FTS5
ENABLE_GEOPOLY
ENABLE_JSON1
ENABLE_RTREE
ENABLE_STMTVTAB
MAX_TRIGGER_DEPTH=100
TEMP_STORE=1
THREADSAFE=1

As mentioned by @Ahmed and @Jeremy in the previous answer,

Confirm that the DLL files have been added in the correct place

However, make sure that it is indeed the correct place. For example, if you're working in a virtual environment, the location is not C:\ProgramData\Anaconda3\DLLs .

Check where python is installed to find the correct place.

You can copy the downloaded sqlite files in C:\Users\ (usernamefolder)\anaconda3\DLLs and check for the enabled extensions using the following syntax in jupyter notebook.

  import sqlite3
  conn = sqlite3.connect(':memory:')
  cur = conn.cursor()
  conn.enable_load_extension(True)

for (val,) in cur.execute('pragma compile_options'): 
    print (val)

This will give the list of extensions which are enabled and FTS-4 will be one of them. In case you tried and it still hasn't been enabled you can uninstall and reinstall anaconda package and try repeating the procedure.

This is what worked for me

install this in anacoda prompt using the comand below

conda install -c conda-forge sqlite-fts4

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM