我已经破坏了未找到命令?

我已经破坏了未找到命令?

当我尝试升级 ember-cli 时,我正在摆弄 bower、npm 和 node,结果弄坏了一些奇怪的东西。

每当我输入终端中找不到的命令时,都会出现以下 Python 错误。有人能帮我诊断一下问题吗?

my@my_machine:~$ a # or anything else that is not an installed program or bash command
Traceback (most recent call last):
  File "/usr/lib/python3.5/dbm/gnu.py", line 4, in <module>
    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 <module>
    import dbm.gnu as gdbm
  File "/usr/lib/python3.5/dbm/gnu.py", line 6, in <module>
    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 <module>
    from CommandNotFound.util import crash_guard
  File "/usr/lib/python3/dist-packages/CommandNotFound/__init__.py", line 3, in <module>
    from CommandNotFound.CommandNotFound import CommandNotFound
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module>
    import gdbm
ImportError: No module named 'gdbm'

我尝试重新安装:

$ sudo apt-get install --reinstall python3-gdbm 
$ sudo apt-get install --reinstall python-gdbm

但这并没有改变什么。

答案1

似乎与我最近升级到 python 3.5.0 有关。恢复到 3.4.3,现在可以正常工作。

相关内容