Re: Does Python 2.5.2's embedded SQLite support full text searching?

Discussion in 'Python' started by Ed Leafe, Apr 21, 2008.

  1. Ed Leafe

    Ed Leafe Guest

    On Apr 21, 2008, at 1:05 PM, Daniel Fetchinson wrote:

    > Sqlite itself is not distributed with python. Only a python db api
    > compliant wrapper is part of the python stdlib and as such it is
    > completely independent of the sqlite build.


    Don't most binary distributions include SQLite itself? I installed
    2.5.2 on a new WinXP VM, and SQLite is working fine.

    -- Ed Leafe
     
    Ed Leafe, Apr 21, 2008
    #1
    1. Advertising

  2. Ed Leafe

    Guest

    Does Python 2.5 include or not include SQLite engine?

    While reading feedback to my post "Does Python 2.5.2's embedded SQLite
    support full text searching?" I noticed that there appears to be some
    confusion regarding whether Python 2.5 includes the SQLite engine.

    My Windows 2.5.2 binary download includes SQLite.

    But other posters claim otherwise, re: Linux releases of Python 2.5?

    I thought one of the major features of Python 2.5 was its embedded
    SQLite engine.

    Thoughts?

    Malcolm
     
    , Apr 22, 2008
    #2
    1. Advertising

  3. Re: Does Python 2.5 include or not include SQLite engine?

    Dennis Lee Bieber schrieb:
    > On Mon, 21 Apr 2008 19:05:46 -0400, declaimed the
    > following in comp.lang.python:
    >
    >> I thought one of the major features of Python 2.5 was its embedded
    >> SQLite engine.
    >>

    > No, just the inclusion of the adapter became standard... The
    > packagers of Windows installers include the SQLite3 DLL as it isn't a
    > commonly available item... But many Linux versions probably include it
    > as an option during the OS install.


    AFAIK thats wrong. On my ubuntu gutsy for example, I find this:

    deets@absinth:~$ find /usr/lib/python2.5/ | grep -i sqlite
    /usr/lib/python2.5/lib-dynload/_sqlite3.so
    /usr/lib/python2.5/site-packages/pysqlite-2.3.2.egg-info
    /usr/lib/python2.5/site-packages/pysqlite2
    /usr/lib/python2.5/site-packages/pysqlite2/__init__.py
    /usr/lib/python2.5/site-packages/pysqlite2/__init__.pyc
    /usr/lib/python2.5/site-packages/pysqlite2/_sqlite.so
    /usr/lib/python2.5/site-packages/pysqlite2/dbapi2.py
    /usr/lib/python2.5/site-packages/pysqlite2/dbapi2.pyc
    /usr/lib/python2.5/sqlite3
    /usr/lib/python2.5/sqlite3/__init__.py

    ....


    As you can see, stock 2.5 ships with its OWN version of sqlite, and I
    additionally installed the pysqlite-wrapper for whatever reason I now
    can't remember.

    Diez
     
    Diez B. Roggisch, Apr 22, 2008
    #3
  4. Re: Does Python 2.5 include or not include SQLite engine?

    schrieb:
    > While reading feedback to my post "Does Python 2.5.2's embedded SQLite
    > support full text searching?" I noticed that there appears to be some
    > confusion regarding whether Python 2.5 includes the SQLite engine.
    >
    > My Windows 2.5.2 binary download includes SQLite.
    >
    > But other posters claim otherwise, re: Linux releases of Python 2.5?
    >
    > I thought one of the major features of Python 2.5 was its embedded
    > SQLite engine.
    >
    > Thoughts?


    It is embedded. Period. You can install the pysqlite wrapper
    additionally, if you need a newer/differen sqlite version. It will be
    available as a different module, though.

    Diez
     
    Diez B. Roggisch, Apr 22, 2008
    #4
  5. Ed Leafe

    Paul Melis Guest

    Re: Does Python 2.5 include or not include SQLite engine?

    Hi,

    Diez B. Roggisch wrote:
    > Dennis Lee Bieber schrieb:
    >
    >> On Mon, 21 Apr 2008 19:05:46 -0400, declaimed the
    >> following in comp.lang.python:
    >>
    >>> I thought one of the major features of Python 2.5 was its embedded
    >>> SQLite engine.
    >>>

    >> No, just the inclusion of the adapter became standard... The
    >> packagers of Windows installers include the SQLite3 DLL as it isn't a
    >> commonly available item... But many Linux versions probably include it
    >> as an option during the OS install.

    >
    >
    > AFAIK thats wrong. On my ubuntu gutsy for example, I find this:
    >
    > deets@absinth:~$ find /usr/lib/python2.5/ | grep -i sqlite
    > /usr/lib/python2.5/lib-dynload/_sqlite3.so
    > /usr/lib/python2.5/site-packages/pysqlite-2.3.2.egg-info
    > /usr/lib/python2.5/site-packages/pysqlite2
    > /usr/lib/python2.5/site-packages/pysqlite2/__init__.py
    > /usr/lib/python2.5/site-packages/pysqlite2/__init__.pyc
    > /usr/lib/python2.5/site-packages/pysqlite2/_sqlite.so
    > /usr/lib/python2.5/site-packages/pysqlite2/dbapi2.py
    > /usr/lib/python2.5/site-packages/pysqlite2/dbapi2.pyc
    > /usr/lib/python2.5/sqlite3
    > /usr/lib/python2.5/sqlite3/__init__.py
    >
    > ...
    >
    >
    > As you can see, stock 2.5 ships with its OWN version of sqlite, and I
    > additionally installed the pysqlite-wrapper for whatever reason I now
    > can't remember.


    The _sqlite3.so is only a wrapper around the real sqlite library.
    Compiling a fresh Python 2.5.2 install here gives:

    15:46|paul@tabu:~/py25/lib/python2.5/lib-dynload> ldd _sqlite3.so
    linux-gate.so.1 => (0x00748000)
    libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00111000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x00631000)
    libc.so.6 => /lib/libc.so.6 (0x00d1b000)
    /lib/ld-linux.so.2 (0x00749000)

    I.e. the _sqlite3 module links against the system-wide installed Sqlite
    version.

    Furthermore, checking the Python source distribution will show that
    there is no included version of the whole Sqlite library, only the
    wrapper code. How your Linux distribution packages Python w.r.t. the
    sqlite3 module is different per distro.

    Regards,
    Paul
     
    Paul Melis, Apr 22, 2008
    #5
  6. Re: Does Python 2.5 include or not include SQLite engine?

    Paul Melis schrieb:
    > Hi,
    >
    > Diez B. Roggisch wrote:
    >> Dennis Lee Bieber schrieb:
    >>
    >>> On Mon, 21 Apr 2008 19:05:46 -0400, declaimed the
    >>> following in comp.lang.python:
    >>>
    >>>> I thought one of the major features of Python 2.5 was its embedded
    >>>> SQLite engine.
    >>>>
    >>> No, just the inclusion of the adapter became standard... The
    >>> packagers of Windows installers include the SQLite3 DLL as it isn't a
    >>> commonly available item... But many Linux versions probably include it
    >>> as an option during the OS install.

    >>
    >>
    >> AFAIK thats wrong. On my ubuntu gutsy for example, I find this:
    >>
    >> deets@absinth:~$ find /usr/lib/python2.5/ | grep -i sqlite
    >> /usr/lib/python2.5/lib-dynload/_sqlite3.so
    >> /usr/lib/python2.5/site-packages/pysqlite-2.3.2.egg-info
    >> /usr/lib/python2.5/site-packages/pysqlite2
    >> /usr/lib/python2.5/site-packages/pysqlite2/__init__.py
    >> /usr/lib/python2.5/site-packages/pysqlite2/__init__.pyc
    >> /usr/lib/python2.5/site-packages/pysqlite2/_sqlite.so
    >> /usr/lib/python2.5/site-packages/pysqlite2/dbapi2.py
    >> /usr/lib/python2.5/site-packages/pysqlite2/dbapi2.pyc
    >> /usr/lib/python2.5/sqlite3
    >> /usr/lib/python2.5/sqlite3/__init__.py
    >>
    >> ...
    >>
    >>
    >> As you can see, stock 2.5 ships with its OWN version of sqlite, and I
    >> additionally installed the pysqlite-wrapper for whatever reason I now
    >> can't remember.

    >
    > The _sqlite3.so is only a wrapper around the real sqlite library.
    > Compiling a fresh Python 2.5.2 install here gives:
    >
    > 15:46|paul@tabu:~/py25/lib/python2.5/lib-dynload> ldd _sqlite3.so
    > linux-gate.so.1 => (0x00748000)
    > libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00111000)
    > libpthread.so.0 => /lib/libpthread.so.0 (0x00631000)
    > libc.so.6 => /lib/libc.so.6 (0x00d1b000)
    > /lib/ld-linux.so.2 (0x00749000)
    >
    > I.e. the _sqlite3 module links against the system-wide installed Sqlite
    > version.
    >
    > Furthermore, checking the Python source distribution will show that
    > there is no included version of the whole Sqlite library, only the
    > wrapper code. How your Linux distribution packages Python w.r.t. the
    > sqlite3 module is different per distro.


    Hm. Before posting, I checked this:

    http://svn.python.org/view/external/sqlite-source-3.5.7.x/

    So I got the impression that because the source is there (I admit *not*
    checking the python source distribution itself though) and a library is
    in the python-lib, that python ships with sqlite.

    So - I stand corrected. Given the way some linux distros treat python
    wrt to e.g. distutils, I wonder if there is one out there that does
    *not* have sqlite built-in.

    Diez
     
    Diez B. Roggisch, Apr 22, 2008
    #6
  7. Ed Leafe

    Trent Mick Guest

    Re: Does Python 2.5 include or not include SQLite engine?

    Whether a Python installation includes the SQLite 3 bindings typically
    depends on:

    1. Python version: core support for the SQLite 3 bindings (i.e. the
    "sqlite3" module) was added in Python 2.5. Earlier versions of Python
    may also have a 3rd-party package/module that adds SQLite bindings, of
    course.

    2. The Python distro: The binary Python 2.5 installers from python.org
    (for Windows and Mac OS X [^1]) and ActiveState, i.e. ActivePython, (for
    Windows, Mac OS X, Linux, Solaris, HP-UX and AIX) include the "sqlite3"
    module as part of the installer. I don't know about other Python
    distributions.

    3. Platform: Commonly on Linux one will get Python from the Linux
    distro's own packaging utility (e.g., apt-get, rpm, synaptic, yum, etc.)
    Typically the Linux distros will break up a Python installation into
    multiple packages. So an installation of, say, the "python2.5" package
    will often not have the "sqlite3" module. To get it you would have to
    install the separate "python2.5-sqlite" package. (Note: the names of
    these packages vary with Linux distro and version of that distro.)



    Cheers,
    Trent

    [1]: I could be wrong about whether the Mac OS X binary installer for
    Python 2.5 from python.org includes the "sqlite3" module -- I haven't
    checked -- but I presume it does.


    Banibrata Dutta wrote:
    > Doesn't this depend on the source / distro ? My Python is from the
    > ActivePython distro, while I am not sure (since I've just about started
    > playing with it), I haven't seen SQLite included ... possible that I
    > missed it.
    >
    > On 4/22/08, * <mailto:p>*
    > < <mailto:p>> wrote:
    >
    > While reading feedback to my post "Does Python 2.5.2's embedded SQLite
    > support full text searching?" I noticed that there appears to be some
    > confusion regarding whether Python 2.5 includes the SQLite engine.
    >
    > My Windows 2.5.2 binary download includes SQLite.
    >
    > But other posters claim otherwise, re: Linux releases of Python 2.5?
    >
    > I thought one of the major features of Python 2.5 was its embedded
    > SQLite engine.
    >
    > Thoughts?



    --
    Trent Mick
    trentm at activestate.com
     
    Trent Mick, Apr 22, 2008
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samuel R. Neff
    Replies:
    2
    Views:
    622
    bradley
    Jun 10, 2005
  2. Replies:
    0
    Views:
    257
  3. Daniel Fetchinson
    Replies:
    3
    Views:
    346
    Daniel Fetchinson
    Apr 22, 2008
  4. Guillermo
    Replies:
    1
    Views:
    394
    Gerhard Häring
    Oct 28, 2008
  5. Guillermo
    Replies:
    2
    Views:
    298
    Gerhard Häring
    Oct 28, 2008
Loading...

Share This Page