我已经安装了 Matlab,但安装后我无法使用终端执行任何操作,它显示以下错误:
~$ pip install flask
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'
答案1
sudo apt install --reinstall python3-apt
这将重新安装 apt_pkg,并修复它不存在 /usr/lib/python3/dist-packages 的错误。