SQLite3__Python2.3-SQLite__Problem

Jonathan Ballet multani at free.fr
Fri Nov 24 21:52:22 CET 2006


Le Fri, 24 Nov 2006 13:18:14 -0600,
Cousin Stanley <cousinstanley at hotmail.com> a écrit :
> 
>    This problem is occuring under Debian GNU/Linux Sarge 
>    using Python 2.3 ....
> 

Hi,

if you look at
http://packages.debian.org/stable/python/python2.3-sqlite,
you will see that the python2.3-sqlite package is built against
SQLite 2. This is why you have a "file is encrypted or is not a
database" message, since databases created with SQLite 2.x are not
file-compatible with SQLite 3.x file.


So, if you can find a Python binding for SQLite 3, go for it, but,
unless you are building it from scratch (I mean, not from a Debian
package), it might be difficult to find.

Otherwise, use the sqlite command line tool (not sqlite3), which is
built against SQLite 2.x.
If you go for this solution, it's easy to migrate from a 2.x to a 3.x
database, something like :
$ echo ".dump" sqlite database.db.2x | sqlite3 database.db.3x
(you will have to change the Python accordingly, of course ;)

Hope it helps,

 - Jon



More information about the Python-list mailing list