Python 2.5 and sqlite

Thorsten Kampe thorsten at thorstenkampe.de
Wed Nov 12 03:46:16 EST 2008


*  (Tue, 11 Nov 2008 17:58:15 -0500)
> > > Can you ask them if sqlite3 is installed? and if not... to install
> > > it?
> >
> > Why would he have to install SQLite?!
> 
> Seems a stupid question. If he wants to use SQLite... it needs to be
> on the system....

No.
 
> ould include in your discussions "well sqlite3 is part of python"
> >> > "if it isn't, you haven't installed python properly"
> >>
> >> Sqlite3 is an optional part of Python.
> 
> But Python itself is dependent upon SQlite3 being installed first...
> 
> try it yourself...
> 
> first compile python 2.5 from source without SQLite.. see if it  
> works... it won't.
> 
> Install Sqlite first... then compile python 2.5 from source.. python  
> sqlite support will work...
> 
> The dependency is within the make files of python 2.5. It checks  
> whether sqlite is installed on the machine and includes support if it  
> is there.. if not.. doesn't support it...
> 
> It is very logical....

Not at all. If you would distribute a script that uses SQLite and it 
would depend on whether SQLite is installed or not that would be a 
huuuuuge disadvantage.

Python cannot check whether SQLite is installed or not. It checks 
whether it can find the SQLite header files. So the SQLite source (or 
the binary) is only needed for compiling Python. If you build SQLite 
support as a shared library, you need the libsqlite package (not the 
SQLite binary itself) at runtime. If you build it static, you don't need 
SQLite at all at runtime. See Martin's answer in the same thread.

Thorsten



More information about the Python-list mailing list