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

hawk gao gaohawk at gmail.com
Thu Oct 30 17:01:23 CET 2008


actually, the latest situation is

debian:~/pysqlite-2.5.0/doc# python
>>> from pysqlite2 import dbapi2 as sqlite3
>>> con = sqlite3.connect(":memory:")
>>> con.execute("CREATE VIRTUAL TABLE posts using FTS3(title, body);")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pysqlite2.dbapi2.OperationalError: no such module: FTS3


---------- Forwarded message ----------
From: hawk gao <gaohawk at gmail.com>
Date: 2008/10/30
Subject: Re: how to get full-text search of pysqlite3 work in python2.5.2
To: Guilherme Polo <ggpolo at gmail.com>


I build and install a 3.6.4 by following this guide
http://www.sqlite.org/cvstrac/wiki?p=CompilingFts
eventually, i can run "CREATE VIRTUAL TABLE posts using FTS3(title, body);"
under sqlite3 command line.

debian:~/pysqlite-2.5.0# sqlite3
SQLite version 3.6.4
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE VIRTUAL TABLE posts using FTS3(title, body);
sqlite>

then i rebuild and reinstall pysqlite2.5.0.  but, even "from pysqlite2
import dbapi2 as sqlite3" cannot be accepted.

debian:~/pysqlite-2.5.0# python
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.
>>> from pysqlite2 import dbapi2 as sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pysqlite2/dbapi2.py", line 27, in <module>
    from pysqlite2._sqlite import *
ImportError: No module named _sqlite


2008/10/30 Guilherme Polo <ggpolo at gmail.com>

> On 10/30/08, hawk gao <gaohawk at gmail.com> wrote:
>
> > Thanks for your advice. but the problem still here.
> >
> > debian:~/sqlite-3.6.4-build# python
> > 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.
> >  >>> from pysqlite2 import dbapi2 as sqlite3
> > >>> con = sqlite3.connect(":memory:")
> > >>> con.execute("CREATE VIRTUAL TABLE posts using FTS3(title, body);")
> > Traceback (most recent call last):
> >    File "<stdin>", line 1, in <module>
> > pysqlite2.dbapi2.OperationalError: no such module: FTS3
> >
>
> Yes... you have to compile pysqlite against the sqlite library that
> has the builtin support fot fts3. pysqlite is probably being compiled
> against the sqlite found in /usr/lib, while the sqlite with fts3
> support is at /usr/local/lib.
>
> --
> -- Guilherme H. Polo Goncalves
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081031/9f1457ea/attachment.html>


More information about the Python-list mailing list