How can I import the sqlite3 module into Python 2.4? How can I import the sqlite3 module into Python 2.4? sqlite sqlite

How can I import the sqlite3 module into Python 2.4?


I had same problem with CentOS and python 2.4

My solution:

yum install python-sqlite2

and try following python code

try:    import sqlite3except:    from pysqlite2 import dbapi2 as sqlite3


Did you install it? That often works better than messing with sys.path.

python setup.py install

If so, you should then find it.

If, for some reason, you can't install it, set the PYTHONPATH environment variable. Do not make a habit of messing with sys.path.


You will need to install pysqlite. Notice, however, that this absolutely does require a compiler, unless you can find binaries for it (and Python 2.4) on the net. Using the 2.5 binaries will not be possible.