[CentralOH] pysqlite2

Mark Erbaugh mark at microenh.com
Sat Apr 11 20:28:50 CEST 2009

I'm trying to build pysqlite2 against a version of sqlite3 that is not
installed as the default version.  Basically, I built a web app on my
local machine against sqlite 3.4.2 and went to install it on my web
server. They have sqlite 3.2.1 installed. I discovered that there were
some changes between 3.2.1 and 3.4.2 that are important to my app.
Rather than change my app, I thought I'd upgrade pysqlite2.  I'm just a
customer of the web server and don't have superuser access.

First, my understanding is that all the database access code is built
into pysqlite2, there is no "server" required.  It's just a matter of
getting _sqlite.so (part of pysqlite2) built with the proper code.

I downloaded and built the latest sqlite 3.6.12, using ./configure
--prefix=/home/mark/Projects/sqlite/install, make and make install
(where install is a local user writeable directory).  If I go into the
install directory and launch the command-line sqlite3, it indicates the
correct version 3.6.12.

pysqlite2 (version 2.5.5) is built using distutils and has a setup.cfg
file that is supposed to be modifiable for my situation. Here's the


I modified it to:


I assume that # are comments, so I removed them when I edited the
include_dirs and library_dirs.  It appears that the correct -I and -L
parameters are passed to gcc.

The problem, I think is the libraries command.  If I leave it at

libraries=sqlite3 (the default)

pysqlite2 builds, but includes the versions of installed version of

I haven't been able to figure what to do with the libraries line. If I
change it to anything other than sqlite3, the build process complains

for example with 


there is an error message: /usr/bin/ld: cannot find -llibsqlite3

I changed it to

libraries = /home/mark/Projects/sqlite/install/lib/libsqlite3

and gcc complained

warning: no library file corresponding to
'/home/mark/Projects/sqlite/install/lib/libsqlite3' found (skipping)

There are several other files in the install/lib directory, but I get
similar errors with them all. FWIW, there is no sqlite3 file.  The only
sqlite3 file in the install tree is an executable which runs the sqlite
command line program (which indicates the proper version).

Obviously, I'm in over my head in understanding what's going on. Any
help would be appreciated.


More information about the CentralOH mailing list