how to get full-text search of pysqlite3 work in python2.5.2

H

hawk

Hi,
my environment is debian, python 2.5.2.
when i call con.enable_load_extension(True), the following message
prompt out.
debian:~# python2.5
Python 2.5 (release25-maint, Jul 20 2008, 20:47:25)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'sqlite3.Connection' object has no attribute
'enable_load_extension'

Thanks
Hawk
 
G

Guilherme Polo

Hi,
my environment is debian, python 2.5.2.
when i call con.enable_load_extension(True), the following message
prompt out.
debian:~# python2.5
Python 2.5 (release25-maint, Jul 20 2008, 20:47:25)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'sqlite3.Connection' object has no attribute
'enable_load_extension'

enable_load_extension was added in pysqlite 2.5, but python 2.5.2
includes an older version of pysqlite.
 
H

hawk

Hi,
 my environment is debian, python 2.5.2.
 when i call con.enable_load_extension(True), the following message
 prompt out.
 debian:~# python2.5
 Python 2.5 (release25-maint, Jul 20 2008, 20:47:25)
 [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import sqlite3
 >>> con = sqlite3.connect(":memory:")
 >>> con.enable_load_extension(True)
 Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
 AttributeError: 'sqlite3.Connection' object has no attribute
 'enable_load_extension'

enable_load_extension was added in pysqlite 2.5, but python 2.5.2
includes an older version of pysqlite.
 Thanks
 Hawk

i have solved this problem by install from latest source package. but,
another issue raised, when i called con.execute("select
load_extension('./fts3.so')") and con.execute("CREATE VIRTUAL TABLE
posts using FTS3(title, body);"). the error message is,
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pysqlite2.dbapi2.OperationalError: extension loading is disabled

i checked whole file system for fts.so. but there is no fts3.so
anymore. then i downloaded the full source code of latest sqlite, and
compiled it. but also, no fts2.so exists under build folder. finally,
i downloaded sqlite-amalgamation-3_6_4.zip and compiled it with
CFLAGS="-DSQLITE_ENABLE_FTS3=1" option. the whole command line is
"CFLAGS="-DSQLITE_ENABLE_FTS3=1" ./configure". unfortunately, the
fts3.so cannot be found too.
how can i get the fts2.so!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
H

hawk

sorry, all fts2 is fts3.
Hi,
 my environment is debian, python 2.5.2.
 when i call con.enable_load_extension(True), the following message
 prompt out.
 debian:~# python2.5
 Python 2.5 (release25-maint, Jul 20 2008, 20:47:25)
 [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import sqlite3
 >>> con = sqlite3.connect(":memory:")
 >>> con.enable_load_extension(True)
 Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
 AttributeError: 'sqlite3.Connection' object has no attribute
 'enable_load_extension'
enable_load_extension was added in pysqlite 2.5, but python 2.5.2
includes an older version of pysqlite.

i have solved this problem by install from latest source package. but,
another issue raised, when i called con.execute("select
load_extension('./fts3.so')") and con.execute("CREATE VIRTUAL TABLE
posts using FTS3(title, body);"). the error message is,

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pysqlite2.dbapi2.OperationalError: extension loading is disabled

i checked whole file system for fts.so. but there is no fts3.so
anymore. then i downloaded the full source code of latest sqlite, and
compiled it. but also, no fts2.so exists under build folder. finally,
i downloaded sqlite-amalgamation-3_6_4.zip and compiled it with
CFLAGS="-DSQLITE_ENABLE_FTS3=1" option. the whole command line is
"CFLAGS="-DSQLITE_ENABLE_FTS3=1" ./configure". unfortunately, the
fts3.so cannot be found too.
how can i get the fts2.so!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
G

Guilherme Polo

Hi,
my environment is debian, python 2.5.2.
when i call con.enable_load_extension(True), the following message
prompt out.
debian:~# python2.5
Python 2.5 (release25-maint, Jul 20 2008, 20:47:25)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import sqlite3
con = sqlite3.connect(":memory:")
con.enable_load_extension(True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'sqlite3.Connection' object has no attribute
'enable_load_extension'

enable_load_extension was added in pysqlite 2.5, but python 2.5.2
includes an older version of pysqlite.

i have solved this problem by install from latest source package. but,
another issue raised, when i called con.execute("select
load_extension('./fts3.so')") and con.execute("CREATE VIRTUAL TABLE
posts using FTS3(title, body);"). the error message is,

Traceback (most recent call last):
File "<stdin>", line 1, in <module>

pysqlite2.dbapi2.OperationalError: extension loading is disabled

i checked whole file system for fts.so. but there is no fts3.so
anymore. then i downloaded the full source code of latest sqlite, and
compiled it. but also, no fts2.so exists under build folder. finally,
i downloaded sqlite-amalgamation-3_6_4.zip and compiled it with
CFLAGS="-DSQLITE_ENABLE_FTS3=1" option. the whole command line is
"CFLAGS="-DSQLITE_ENABLE_FTS3=1" ./configure". unfortunately, the
fts3.so cannot be found too.

If you already compiled sqlite with SQLITE_ENABLE_FTS3 then you don't
need to load a fts3 extension, sqlite is already compiled with it.

Just skip the enable_load_extension and start at con.execute("CREATE
VIRTUAL TABLE posts using FTS3(title, body);").
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top