On python 2.4, use the pysqlite package. This is the same package that was added to the Python standard library in version 2.5 when it was renamed to sqlite3 .
Since this is the same package, there are no differences in the API, and you only need to use the try except ImportError :
try: import sqlite3 except ImportError: from pysqlite2 import dbapi2 as sqlite3
source share