【Ubuntu issues】ModuleNotFoundError: No module named ‘apt_pkg‘

Traceback (most recent call last):

File "/usr/lib/cnf-update-db", line 8, in <module>

from CommandNotFound.db.creator import DbCreator

File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, in <module>

import apt_pkg

ModuleNotFoundError: No module named 'apt_pkg'

This error is often caused by a mismatch between the Python version used by the system and the one required by the apt_pkg module.

复制代码
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
sudo update-alternatives --config python3
相关推荐
IMPYLH2 分钟前
【无标题】
linux·运维·服务器·网络·bash
硬核子牙10 分钟前
软件虚拟化 vs 硬件虚拟化
linux
ShineWinsu11 分钟前
对于Linux:进程间通信IPC(命名管道)的解析
linux·c++·面试·笔试·进程·ipc·命名管道
比昨天多敲两行17 分钟前
Linux权限管理
linux·运维·服务器
runningshark24 分钟前
【Linux】VirtualBox ↔ Ubuntu+WinSCP 文件传输
linux·运维·ubuntu
aidream123940 分钟前
Linux文件操作-文件打包和压缩(tar/gzip/bzip2/xz/zip)
linux·运维·服务器
念恒123061 小时前
进程--进程状态(上)
linux·c语言
捞的不谈~1 小时前
宇树机器狗通过笔记本共享上网操作指南(临时版)
linux·经验分享·tcp/ip·ubuntu
feng_you_ying_li1 小时前
linux之进程优先与切换调度
linux·运维·服务器
光电笑映1 小时前
Linux C/C++ 开发工具(上):包管理器、Vim、gcc/g++ 与动静态库
linux·运维·服务器