5

In the Python 3 docs, it states that the dbm module will use gdbm if it's installed. In my script I use from dbm.gnu import open as dbm_open to try and import the module. It always returns with the exception ImportError: No module named '_gdbm'. I've gone to the gnu website and have downloaded the latest version. I installed it using ./configure --enable-libgdbm-compat, make; make check; make install, and it installed with no errors. I can access the man page for the library but I still can't import it into Python 3.5.2 (Anaconda). How do I install the Python module for gdbm?

Tankobot
  • 1,492
  • 14
  • 21
  • Possible duplicate of [GDBM doesn't work with Python 3.6 and anaconda](https://stackoverflow.com/questions/49113718/gdbm-doesnt-work-with-python-3-6-and-anaconda) – gerrit Jul 02 '18 at 17:59

1 Answers1

0

I got similar issue though I am not sure which platform you are using.

Steps are:

  1. look for file _gdbm.cpython-"python version"-.so example file: _gdbm.cpython-39-darwin.so
  2. Once you find the path check which python version in directory path.
  3. Try creating same python venv.
  4. Execute your code.

Before this make sure you have install appropriate gdbm version installed on host machine, for mac it's different for ubuntu it's different name.

Dharman
  • 30,962
  • 25
  • 85
  • 135
asktyagi
  • 111
  • 1
  • 1
  • 4