Here Is the code related to this error From anydbm.py
from whichdb import whichdb
result=whichdb(file)
if result is None:
# db doesn't exist
if 'c' in flag or 'n' in flag:
# file doesn't exist and the new
# flag was used so use default type
mod = _defaultmod
else:
raise error, "need 'c' or 'n' flag to open new db"
elif result == "":
# db type cannot be determined
raise error, "db type could not be determined"
If whichdb
can open the file but cannot determine the library to use, it returns the empty string.
so question is why its not able to determine the library. May be library required to open this DB file is not installed.
anydbm is a generic interface to variants of the DBM database — dbhash (requires
bsddb), gdbm, or dbm. If none of these modules is installed, the slow-but-simple
implementation in module dumbdbm will be used.
So either you are missing dumbdbm
module(import it and use it instead of anydbm) or you need to install other libraries dbhash gdbm, dbm
to open the file.