我运行的是linuxmint18.3,内核是4.13.0-39-generic。
每次我在终端中运行一个无效的命令或者程序没有安装,我都会得到一个python错误的stacktraceTraceback (most recent call last):
File "/usr/lib/python3.5/dbm/gnu.py", line 4, in
from _gdbm import *
ImportError: No module named '_gdbm'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in
import dbm.gnu as gdbm
File "/usr/lib/python3.5/dbm/gnu.py", line 6, in
raise ImportError(str(msg) + ', please install the python3-gdbm package')
ImportError: No module named '_gdbm', please install the python3-gdbm package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 27, in
from CommandNotFound.util import crash_guard
File "/usr/lib/python3/dist-packages/CommandNotFound/__init__.py", line 3, in
from CommandNotFound.CommandNotFound import CommandNotFound
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in
import gdbm
ImportError: No module named 'gdbm'
要回答第一个问题,是,已安装gdbm:
^{pr2}$