sqlite3.OperationalError: no such module: fts5

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

sqlite3.OperationalError: no such module: fts5

Moslem
This post was updated on .
Hi
my error in UMLS import is :

"""

* Owlready2 * Warning: optimized Cython parser module 'owlready2_optimized' is not available, defaulting to slower Python implementation
Importing UMLS from Zip file 2018AB-full/2018ab-1-meta.nlm...
  Parsing 2018AB/META/MRRANK.RRF.gz as MRRANK...
  Parsing 2018AB/META/MRCONSO.RRF.aa.gz as MRCONSO...
  Parsing 2018AB/META/MRCONSO.RRF.ab.gz as MRCONSO...
  Parsing 2018AB/META/MRDEF.RRF.gz as MRDEF...
Importing UMLS from Zip file 2018AB-full/2018ab-2-meta.nlm...
  Parsing 2018AB/META/MRREL.RRF.aa.gz as MRREL...
  Parsing 2018AB/META/MRREL.RRF.ab.gz as MRREL...
  Parsing 2018AB/META/MRREL.RRF.ac.gz as MRREL...
  Parsing 2018AB/META/MRREL.RRF.ad.gz as MRREL...
  Parsing 2018AB/META/MRREL.RRF.ae.gz as MRREL...
  Parsing 2018AB/META/MRSAT.RRF.aa.gz as MRSAT...
  Parsing 2018AB/META/MRSAT.RRF.ab.gz as MRSAT...
  Parsing 2018AB/META/MRSAT.RRF.ac.gz as MRSAT...
  Parsing 2018AB/META/MRSAT.RRF.ad.gz as MRSAT...
  Parsing 2018AB/META/MRSAT.RRF.ae.gz as MRSAT...
Breaking ORIG cycles...
    SNOMEDCT_US : 0 cycles found:
    ICD10 : 0 cycles found:
    SRC : 0 cycles found:
Finalizing only properties and restrictions...
Finalizing CUI - ORIG mapping...
Indexing...
FTS Indexing...
Traceback (most recent call last):
  File "/home/nikvand/ReportProcess/test.py", line 5, in <module>
    import_umls("umls-2018AB-full.zip", terminologies = ["ICD10", "SNOMEDCT_US", "CUI"])
  File "/home/nikvand/ReportProcess2/lib/python3.7/site-packages/owlready2/pymedtermino2/umls.py", line 699, in import_umls
    default_world.full_text_search_properties.append(label)
  File "/home/nikvand/ReportProcess2/lib/python3.7/site-packages/owlready2/util.py", line 76, in append
    def append(self, x):          old = list(self); super().append(x)         ; self._callback(self._obj, old)
  File "/home/nikvand/ReportProcess2/lib/python3.7/site-packages/owlready2/namespace.py", line 431, in _full_text_search_changed
    self.graph.enable_full_text_search(Prop.storid)
  File "/home/nikvand/ReportProcess2/lib/python3.7/site-packages/owlready2/triplelite.py", line 971, in enable_full_text_search
    self.execute("""CREATE VIRTUAL TABLE fts_%s USING fts5(s UNINDEXED, o, d UNINDEXED, content=datas, content_rowid=rowid)""" % prop_storid)

sqlite3.OperationalError: no such module: fts5

On Tue, May 28, 2019 at 7:43 AM Moslem Samiee <moslemsamiee@gmail.com> wrote:
sqlite3.OperationalError: no such module: fts5

"""


can you help me please ?
thanks
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3.OperationalError: no such module: fts5

Jiba
Administrator
Hi,

It seems that your version of Python do not have SQLite with FTS (Full-Text-Search) support.

Under Linux, SQLite can be a shared library, so you should update Python but also SQLite3.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3.OperationalError: no such module: fts5

Moslem
hi Jiba
thanks  a lot 

On Wed, May 29, 2019 at 2:40 PM Jiba [via Owlready] <[hidden email]> wrote:
Hi,

It seems that your version of Python do not have SQLite with FTS (Full-Text-Search) support.

Under Linux, SQLite can be a shared library, so you should update Python but also SQLite3.

Jiba


If you reply to this email, your message will be added to the discussion below:
http://owlready.8326.n8.nabble.com/sqlite3-OperationalError-no-such-module-fts5-tp1103p1106.html
To unsubscribe from sqlite3.OperationalError: no such module: fts5, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3.OperationalError: no such module: fts5

Billy
In reply to this post by Jiba
Hi Jiba,

I'm facing the same problem.

I'm using windows with anaconda.

I tried to update the sqlite and sqlite3 from anaconda, but do not work.

my version is like follow:

print(__import__("sqlite3").version)
2.6.0

print (__import__("sqlite3").sqlite_version)
3.31.1

print(sys.version)
3.7.6 (default, Jan  8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]


Importing UMLS from Zip file umls-2019AB-metathesaurus.zip with Python version 3.7...
  Parsing 2019AB/META/MRRANK.RRF as MRRANK
  Parsing 2019AB/META/MRCONSO.RRF as MRCONSO
  Parsing 2019AB/META/MRDEF.RRF as MRDEF
  Parsing 2019AB/META/MRREL.RRF as MRREL
  Parsing 2019AB/META/MRSAT.RRF as MRSAT
Breaking ORIG cycles...
    SNOMEDCT_US : 0 cycles found:
    ICD10 : 0 cycles found:
    SRC : 0 cycles found:
Finalizing only properties and restrictions...
Finalizing CUI - ORIG mapping...
FTS Indexing...
---------------------------------------------------------------------------
OperationalError                          Traceback (most recent call last)
<ipython-input-7-a1e6606c43bd> in <module>
----> 1 import_umls("umls-2019AB-metathesaurus.zip", terminologies = ["ICD10", "SNOMEDCT_US", "CUI"])

D:\anaconda3\lib\site-packages\owlready2\pymedtermino2\umls.py in import_umls(umls_zip_filename, terminologies, langs, fts_index, extract_groups, extract_attributes, extract_relations, extract_definitions, remove_suppressed)
    747   if fts_index:
    748     print("FTS Indexing...")
--> 749     default_world.full_text_search_properties.append(label)
    750     default_world.full_text_search_properties.append(PYM.synonyms)
    751

D:\anaconda3\lib\site-packages\owlready2\util.py in append(self, x)
     75   def _replace(self, old, new): super().__setitem__(self.index(old), new)
     76   def reinit(self, l):          old = list(self); super().__init__(l)       ; self._callback(self._obj, old)
---> 77   def append(self, x):          old = list(self); super().append(x)         ; self._callback(self._obj, old)
     78   def insert(self, i, x):       old = list(self); super().insert(i, x)      ; self._callback(self._obj, old)
     79   def extend(self, l):          old = list(self); super().extend(l)         ; self._callback(self._obj, old)

D:\anaconda3\lib\site-packages\owlready2\namespace.py in _full_text_search_changed(self, old)
    474       self.graph.disable_full_text_search(Prop.storid)
    475     for Prop in new - old:
--> 476       self.graph.enable_full_text_search(Prop.storid)
    477
    478   def new_blank_node(self): return self.graph.new_blank_node()

D:\anaconda3\lib\site-packages\owlready2\triplelite.py in enable_full_text_search(self, prop_storid)
   1001     self.execute("""INSERT INTO prop_fts VALUES (?)""", (prop_storid,));
   1002
-> 1003     self.execute("""CREATE VIRTUAL TABLE fts_%s USING fts5(s UNINDEXED, o, d UNINDEXED, content=datas, content_rowid=rowid)""" % prop_storid)
   1004     self.execute("""INSERT INTO fts_%s(rowid, s, o, d) SELECT rowid, s, o, d FROM datas WHERE p=%s""" % (prop_storid, prop_storid))
   1005

OperationalError: no such module: fts5
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3.OperationalError: no such module: fts5

Jiba
Administrator
Hello,

FTS5 is available in Sqlite3 since version 3.9.0. However, it may or may not be compiled.

According to the following link, Anaconda does not include FTS5.

https://github.com/ContinuumIO/anaconda-issues/issues/9034

If not available, the best option is probably to install a fresh version of Python.

Jiba