I want to open a shelve inside a Docker container in the official Python 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 main machine, the problem does not exist, and _bsddb is on /usr/lib/python2.7/lib-dynload/_bsddb.so . This file is also available in my Docker container, so I donβt understand why it cannot be imported.
Ignacio Vazquez-Abrams suggest installing db4-devel , but this package is not available in my container.
How to open a shelf in a docker container?
source share