(in memory) database

Paul Boddie paul at boddie.org.uk
Sun Aug 31 14:45:19 EDT 2008


On 31 Aug, 20:05, cla... at lairds.us (Cameron Laird) wrote:
>
> Let's take a definite example:  I have a convenient
>     Ubuntu 8.04.1
> The content of /etc/apt/sources.list is
>     debhttp://us.archive.ubuntu.com/ubuntuhardy main restricted
>     debhttp://us.archive.ubuntu.com/ubuntuhardy-updates main restricted
>     debhttp://us.archive.ubuntu.com/ubuntuhardy universe multiverse
>     debhttp://security.ubuntu.com/ubuntuhardy-security main restricted
> I do
>     apt-get update
>     apt-get upgrade
>     apt-get install python2.5
> then
>     # python2.5
>     Python 2.5 (r25:51908, Dec 11 2006, 21:09:56)
>     [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
>     Type "help", "copyright", "credits" or "license" for more information.
>     >>> import sqlite3
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in <module>
>       File "/usr/local/lib/python2.5/sqlite3/__init__.py", line 24, in <module>
>         from dbapi2 import *
>       File "/usr/local/lib/python2.5/sqlite3/dbapi2.py", line 27, in <module>
>         from _sqlite3 import *
>     ImportError: No module named _sqlite3
>
> How do you interpret this?

What do you get if you run this command...?

  dpkg -s python2.5

For me, I get something which mentions the following:

  Package: python2.5

  [...]

  Depends: python2.5-minimal (= 2.5.1-0ubuntu1.2), mime-support,
  libbz2-1.0, libc6 (>= 2.5-0ubuntu1), libdb4.4,
  libncursesw5 (>= 5.4-5), libreadline5 (>= 5.2),
  libsqlite3-0 (>= 3.3.13), libssl0.9.8 (>= 0.9.8c-1)

Note the presence of the libsqlite3-0 package. In addition, you should
have the sqlite3 extension module somewhere:

  locate sqlite3.so

This should tell you where the sqlite libraries are as well as where
the extension module is. For me, I get something which includes the
following:

  /usr/lib/python2.5/lib-dynload/_sqlite3.so
  /usr/lib/libsqlite3.so.0

Passing one of these to "dpkg -S" should say which package provided
it.

The strange thing is that the Ubuntu package information for your
version does mention the sqlite dependency and include the extension
module in the list of files:

  http://packages.ubuntu.com/hardy/python2.5

You can run the following command to see whether your python2.5
package really provides the extension module:

  dpkg --listfiles python2.5

Even if the sqlite library is installed, if that package doesn't
provide the extension module, something must be wrong with it because
it should be there.

Paul



More information about the Python-list mailing list