我正在尝试打开一个.db
类型为db.gnu
. 尝试使用内置 Python 3 模块打开它dbm
失败并显示以下消息:
dbm.error: db type is dbm.gnu, but the module is not available
我知道我必须使用gnu
子模块dbm
来打开它。但是,我无法在 macOS 上的 Python 3.6.3 中这样做:
In [1]: import dbm
In [2]: dbm.gnu
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-ddbd370a1085> in <module>()
----> 1 dbm.gnu
AttributeError: module 'dbm' has no attribute 'gnu'
如何dbm.gnu
在 Mac 上使用?