(in memory) database

Cameron Laird claird at lairds.us
Sun Aug 31 15:29:42 EDT 2008


In article <eed3b104-d08d-40e9-8608-a8bee65b3a68 at z72g2000hsb.googlegroups.com>,
Paul Boddie  <paul at boddie.org.uk> wrote:
>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)
For me:
  Depends: libbz2-1.0, libc6 (>= 2.4), libdb4.6, libncursesw5 (>= 5.6+20071006-3), libreadline5 (>= 5.2), libsqlite3-0 (>= 3.4.2), libssl0.9.8 (>= 0.9.8f-1), mime-support, python2.5-minimal (= 2.5.2-2ubuntu4.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
  /usr/lib/python2.5/lib-dynload/_sqlite3.so
  /usr/lib/libsqlite3.so.0.8.6
  /usr/lib/xulrunner-1.9.0.1/libsqlite3.so
  /usr/lib/xulrunner-1.9.0.1/libsqlite3.so.0
  /usr/lib/libsqlite3.so.0
  /usr/lib/libsqlite3.so
>
>Passing one of these to "dpkg -S" should say which package provided
>it.
  libsqlite3-dev: /usr/lib/libsqlite3.so
>
>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
  # dpkg --listfiles python2.5 | grep sqli
  /usr/lib/python2.5/sqlite3
  /usr/lib/python2.5/sqlite3/test
  /usr/lib/python2.5/sqlite3/test/__init__.py
  /usr/lib/python2.5/sqlite3/test/dbapi.py
  /usr/lib/python2.5/sqlite3/test/factory.py
  /usr/lib/python2.5/sqlite3/test/hooks.py
  /usr/lib/python2.5/sqlite3/test/regression.py
  /usr/lib/python2.5/sqlite3/test/transactions.py
  /usr/lib/python2.5/sqlite3/test/types.py
  /usr/lib/python2.5/sqlite3/test/userfunctions.py
  /usr/lib/python2.5/sqlite3/__init__.py
  /usr/lib/python2.5/sqlite3/dbapi2.py
  /usr/lib/python2.5/lib-dynload/_sqlite3.so
>
>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

I'm certainly perplexed, and welcome suggestions.



More information about the Python-list mailing list