我已将 Python 设置为 Python 3.7.9。使用此示例设置为 Python3。此后,我的终端出现问题。当我输入错误命令时。终端设置为 python。就像我正在开发一个 python 程序一样。
$ hello
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 28, in <module>
from CommandNotFound import CommandNotFound
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in <module>
from CommandNotFound.db.db import SqliteDatabase
File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 5, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg