We have a Django project we need to start and cannot build sqlite for the persistent store.
sqlite3-dev headers/libs are not installed in the system by default
I have no root permissions on this box (we are expected to install all we need)
I compiled/installed Python-2.7.3 in /opt/python/current2
I downloaded and compiled sqlite3 source in /home/olib/sqlite-autoconf-307150
I downloaded pysqlite-2.6.3
I modified pysqlite-2.6.3/setup.py to point to my sqlite3 source header and library files
include_dirs = ['/home/olib/sqlite-autoconf-3071501']
library_dirs = ['/home/olib/sqlite-autoconf-3071501/.libs']
/home/olib/pysqlite-2.6.3> echo $PYTHON_HOME
/opt/python/current2
/home/olib/pysqlite-2.6.3> python setup.py install
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/pysqlite2
copying lib/dbapi2.py -> build/lib.linux-x86_64-2.7/pysqlite2
copying lib/dump.py -> build/lib.linux-x86_64-2.7/pysqlite2
copying lib/__init__.py -> build/lib.linux-x86_64-2.7/pysqlite2
creating build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/dbapi.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/userfunctions.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/types.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/dump.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/regression.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/hooks.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/factory.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/transactions.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/__init__.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
creating build/lib.linux-x86_64-2.7/pysqlite2/test/py25
copying lib/test/py25/py25tests.py -> build/lib.linux-x86_64-2.7/pysqlite2/test/py25
copying lib/test/py25/__init__.py -> build/lib.linux-x86_64-2.7/pysqlite2/test/py25
running build_ext
building 'pysqlite2._sqlite' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/home/olib/sqlite-autoconf-3071501 -I/opt/python/current2/include/python2.7 -c src/module.c -o build/temp.linux-x86_64-2.7/src/module.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/home/olib/sqlite-autoconf-3071501 -I/opt/python/current2/include/python2.7 -c src/connection.c -o build/temp.linux-x86_64-2.7/src/connection.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/home/olib/sqlite-autoconf-3071501 -I/opt/python/current2/include/python2.7 -c src/cursor.c -o build/temp.linux-x86_64-2.7/src/cursor.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/home/olib/sqlite-autoconf-3071501 -I/opt/python/current2/include/python2.7 -c src/cache.c -o build/temp.linux-x86_64-2.7/src/cache.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/home/olib/sqlite-autoconf-3071501 -I/opt/python/current2/include/python2.7 -c src/microprotocols.c -o build/temp.linux-x86_64-2.7/src/microprotocols.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/home/olib/sqlite-autoconf-3071501 -I/opt/python/current2/include/python2.7 -c src/prepare_protocol.c -o build/temp.linux-x86_64-2.7/src/prepare_protocol.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/home/olib/sqlite-autoconf-3071501 -I/opt/python/current2/include/python2.7 -c src/statement.c -o build/temp.linux-x86_64-2.7/src/statement.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/home/olib/sqlite-autoconf-3071501 -I/opt/python/current2/include/python2.7 -c src/util.c -o build/temp.linux-x86_64-2.7/src/util.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/home/olib/sqlite-autoconf-3071501 -I/opt/python/current2/include/python2.7 -c src/row.c -o build/temp.linux-x86_64-2.7/src/row.o
gcc -pthread -shared build/temp.linux-x86_64-2.7/src/module.o build/temp.linux-x86_64-2.7/src/connection.o build/temp.linux-x86_64-2.7/src/cursor.o build/temp.linux-x86_64-2.7/src/cache.o build/temp.linux-x86_64-2.7/src/microprotocols.o build/temp.linux-x86_64-2.7/src/prepare_protocol.o build/temp.linux-x86_64-2.7/src/statement.o build/temp.linux-x86_64-2.7/src/util.o build/temp.linux-x86_64-2.7/src/row.o -L/home/olib/sqlite-autoconf-3071501/.libs -lsqlite3 -o build/lib.linux-x86_64-2.7/pysqlite2/**_sqlite.so**
running install_lib
copying build/lib.linux-x86_64-2.7/pysqlite2/_sqlite.so -> /opt/python/current2/lib/python2.7/site-packages/pysqlite2
running install_data
running install_egg_info
Removing /opt/python/current2/lib/python2.7/site-packages/pysqlite-2.6.3-py2.7.egg-info
Writing /opt/python/current2/lib/python2.7/site-packages/pysqlite-2.6.3-py2.7.egg-info
for some reason "_sqlite.so" is built but not "_sqlite3.so" of course this causes Django import to fail
File "/opt/python/current2/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 31, in <module>
raise ImproperlyConfigured("Error loading either pysqlite2 or sqlite3 modules (tried in that order): %s" % exc)
django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named _sqlite3