I want to open a shelve inside a Docker container based in Python's official image, python:2.7.9-wheezy. But I get an import error.
syncer/util.py:19: in get_from_shelve
db = shelve.open(conf.SHELVE_LOCATION)
/usr/local/lib/python2.7/shelve.py:239: in open
return DbfilenameShelf(filename, flag, protocol, writeback)
/usr/local/lib/python2.7/shelve.py:223: in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
/usr/local/lib/python2.7/anydbm.py:84: in open
mod = __import__(result)
/usr/local/lib/python2.7/dbhash.py:7: in <module>
import bsddb
...
E ImportError: No module named _bsddb
On my host machine the problem isn't there and _bsddb
is located at
/usr/lib/python2.7/lib-dynload/_bsddb.so
. This file is also available in my Docker container, so I don't understand why it can't be imported.
Ignacio Vazquez-Abrams suggest to install db4-devel
, but this package isn't available in my container.
How do I open the shelve in the Docker container?