Python pysqlite2 dbapi2 problem
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:开发者_C百科 undefined symbol: sqlite3_enable_shared_cache
What can I do to solve this problem?
Thanks!
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.
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.
精彩评论