Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python:slim does not contain _dbm #814

Closed
iwamot opened this issue Mar 14, 2023 · 3 comments · Fixed by #816
Closed

python:slim does not contain _dbm #814

iwamot opened this issue Mar 14, 2023 · 3 comments · Fixed by #816

Comments

@iwamot
Copy link

iwamot commented Mar 14, 2023

python:slim

$ docker run python:slim python -c 'import dbm.ndbm'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.11/dbm/ndbm.py", line 3, in <module>
    from _dbm import *
ModuleNotFoundError: No module named '_dbm'

$ docker run python:slim find /usr/local/lib/python3.11/lib-dynload/ -name '*dbm*' -print
/usr/local/lib/python3.11/lib-dynload/_gdbm.cpython-311-x86_64-linux-gnu.so

python

$ docker run python python -c 'import dbm.ndbm'

$ docker run python find /usr/local/lib/python3.11/lib-dynload/ -name '*dbm*' -print
/usr/local/lib/python3.11/lib-dynload/_dbm.cpython-311-x86_64-linux-gnu.so
/usr/local/lib/python3.11/lib-dynload/_gdbm.cpython-311-x86_64-linux-gnu.so

Is it possible to include it? Or could you please advise me how to use it?

@tianon
Copy link
Member

tianon commented Mar 16, 2023

Hmm, interesting -- I'm not sure what we're missing -- I've tried looking in Debian's python3.X package sources for clues, and I'm coming up empty. 😕

Given that the non-slim is working, it's likely that we need to install some additional package from https://github.com/docker-library/buildpack-deps/blob/65d69325ad741cea6dee20781c1faaab2e003d87/debian/bullseye/Dockerfile (or one of the dependencies of those), but it's difficult to narrow down which one. 😅

@tianon
Copy link
Member

tianon commented Mar 16, 2023

Ah, doing ldd on /usr/local/lib/python3.11/lib-dynload/_dbm.cpython-311-x86_64-linux-gnu.so gives libdb-5.3.so, which is part of libdb5.3, so I bet what we need is libdb-dev? 🤔

@iwamot
Copy link
Author

iwamot commented Mar 17, 2023

Thank you for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants