views:

136

answers:

2

I'm having an issue with the line:

from pysqlite2 import dbapi2 as sqlite

The error i'm getting is:

ImportError: /usr/lib/python2.4/site-packages/pysqlite2/_sqlite.so: undefined symbol: sqlite3_enable_shared_cache

What can I do to solve this problem?

Thanks!

+2  A: 

Sounds like _sqlite.so was compiled against a newer version of sqlite than you have installed. That function wasn't added to SQLite's API until version 3.5.0.

jamessan
Is the solution to install a newer version of sqlite? What package would this be. Short of installing a newer version of sqlite, do you know where I can find documentation about pysqlite2? I haven't found any documentation that doesn't involve dbapi2. Thanks.
Jordan
If my guess is correct, yes. Which package depends on what distribution you're running. Ideally, this would've been handled by package dependencies (as it is on Debian/Ubuntu) and you wouldn't have run into this situation.
jamessan
It turns out that my issue was due to some untimely installs and uninstalls on the system. I'm not the administrator on the system, so there's a good chance I'll never know what the actual fix was. Thanks for your response though.
Jordan
A: 

The easiest way around this problem is to get the AS package Python 2.6 or later from Activestate and install that. It comes with SQLITE in the standard library.

The AS package is a tarball and you install it in a user directory by running a shell script after unpacking the archive. This does not touch any of the Python bits installed with your system, and gives you a fully controlled Python environment that is easy to replicate on other systems regardless of the distro.

Python's packaging system doesn't interoperate well with Linux distro package systems, especially because the Linux distros can be considerably out of date.

Michael Dillon