Does Python 2.5 include or not include SQLite engine?

Paul Melis paul at science.uva.nl
Tue Apr 22 09:49:58 EDT 2008


Hi,

Diez B. Roggisch wrote:
> Dennis Lee Bieber schrieb:
> 
>> On Mon, 21 Apr 2008 19:05:46 -0400, python at bdurham.com 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 at 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 at 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



More information about the Python-list mailing list