简体   繁体   English

OperationalError:没有这样的模块:fts4

[英]OperationalError: no such module: fts4

Hi I´ve tried to run a fuzzymatcher code and the error below pops up:您好,我尝试运行 fuzzymatcher 代码并弹出以下错误:

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.编辑:我已经尝试从网站下载 sqlite zip 并将其保存在 DLL 文件中,但它仍然不起作用。 Do I have to activate it somehow?我必须以某种方式激活它吗?

I´m using Anaconda3 64 bit.我使用的是 Anaconda3 64 位。

Thanks谢谢

  1. Confirm that the DLL files have been added in the correct place;确认 DLL 文件已添加到正确位置; if you are using Windows it will be C:\ProgramData\Anaconda3\DLLs .如果您使用的是 Windows 它将是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,正如@Ahmed 和@Jeremy 在上一个答案中提到的,

Confirm that the DLL files have been added in the correct place确认 DLL 文件已添加到正确位置

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 .例如,如果您在虚拟环境中工作,则该位置不是C:\ProgramData\Anaconda3\DLLs

Check where python is installed to find the correct place. 检查 python 的安装位置以找到正确的位置。

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.您可以将下载的 sqlite 文件复制到 C:\Users\ (usernamefolder)\anaconda3\DLLs 中,并在 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.这将给出已启用的扩展列表,FTS-4 将是其中之一。 In case you tried and it still hasn't been enabled you can uninstall and reinstall anaconda package and try repeating the procedure.如果您尝试过但仍未启用,您可以卸载并重新安装 anaconda package 并尝试重复该过程。

This is what worked for me这对我有用

install this in anacoda prompt using the comand below使用下面的命令在 anacoda 提示符下安装它

conda install -c conda-forge sqlite-fts4 conda 安装-c conda-forge sqlite-fts4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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