problems importing "bsddb"

Andrew MacIntyre andymac at bullseye.apana.org.au
Thu Aug 14 01:42:47 CEST 2003


On Tue, 12 Aug 2003, Skip Montanaro wrote:

>     John> We are using OpenBSD latest release of Python (2.3),  and want to
>     John> use the "bsddb" module.   Our python release has a directory
>     John> called "bsddb",  but when we try and import it,   it says
>     >>> import bsddb
>      Traceback (most recent call last):
>        File "<stdin>", line 1, in ?
>        File "/usr/local/lib/python2.3/bsddb/__init__.py", line 40, in ?
>          import _bsddb
>      ImportError: No module named _bsddb
>
> You need to install version 3 or 4 of Berkeley DB.  It may be available as
> part of OpenBSD or as a port, but you can get the source from
>
>     http://www.sleepycat.com/
>
> and install it from source easily.  Once you've done that, rerun
>
>     python setup.py install
>
> in the Python source tree.

I'm sure that OpenBSD also has BSD DB v1.85 in its libc.  If you are
wanting to access system DB files (terminal capabilities, master password
etc), then you will need to use this instead of Sleepycat's DB3/4 - it
should be available as the bsddb185 module.  If your code is compatible
with the old bsddb module, you could do this as

    import bsddb185 as bsddb

Before Skip goes up in flames, only use the bsddb185 module if you have
to.

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac at bullseye.apana.org.au  (pref) | Snail: PO Box 370
        andymac at pcug.org.au             (alt) |        Belconnen  ACT  2616
Web:    http://www.andymac.org/               |        Australia





More information about the Python-list mailing list