I'm looking to use pyenv to manage multiple python versions within a docker image. I'm currently having an issue when running python2.7.17
in a debian:buster-slim
image where it is missing a package dbm
:
Python 2.7.17 (default, Apr 22 2021, 18:07:32)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named dbm
What's interesting the system version of python loads this module just fine:
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbm
>>> print(dbm)
<module 'dbm' from '/usr/lib/python2.7/lib-dynload/dbm.x86_64-linux-gnu.so'>
Pyenv Python3 install does not have this issue. This is only occurring with Python2.7.
I found this post which is some what related but had no luck with the solution: GDBM doesn't work with Python 3.6 and anaconda
Any ideas why I'm missing dbm.so
when using pyenv but not when using my system version python?