2

When doing

import dbm.gnu

on a standard Python 3.7.6 (64) for Windows, I get:

File "C:\Python37\lib\dbm\gnu.py", line 3, in
from _gdbm import *
ModuleNotFoundError: No module named '_gdbm'

Isn't dbm.gnu supported out of the box on Windows?


  • The same problem happens with:

    import dbm.ndbm
    

    File "C:\Python37\lib\dbm\ndbm.py", line 3, in
    from _dbm import *
    ModuleNotFoundError: No module named '_dbm'

  • I tested on another Python 3.6.8, and it's the same.

Basj
  • 41,386
  • 99
  • 383
  • 673

1 Answers1

1

This has always been the case (that gdbm and ndbm are not supported on windows). See also issue 3769 for background and dbm and windows, and issue 3783 for something to work on if you want to contribute to making the dbm story on windows better.

Googling found a gdbm port to windows, so if you are trying to use source files from linux, that might help you. We're open to suggestions on improving the situation here, but someone has to figure out what would make sense and champion it. Bundling the gdbm windows port is probably not an option, but making it possible to install something via PIP that will work is, if there's anything in core preventing that currently.

pegasus
  • 21
  • 6