今天在运行.sh 文件时突然报一下错误: 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 ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: file too short Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in <module> from apport.report import Report File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module> import apport.fileutils File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module> from apport.packaging_impl import impl as packaging File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module> import apt File "/usr/lib/python3/dist-packages/apt/init.py", line 23, in <module> import apt_pkg ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: file too short</module></module></module></module></module></module></module></module>
Original exception was: 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 ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: file too short</module></module></module>
网上大概查了一下基本都是 no module name apt_pkg 的错误,按照上面的方法流程走一遍也没有修正错误。好像是 linux 的库设置有问题,但是一直到现在也没有修改好。
1
MekoPan OP dist-packages 目录下存在 apt_pkg.cpython-36m-x86_64-linux-gnu.so 该文件,且我的 python 指向为 3.6 版本
|
2
MekoPan OP 好像是 apt_pkg.cpython-36m 文件损坏的问题,我打开此文件是空的,那么如何重新获取该文件呢
|
3
MekoPan OP 有没有 apt_pkg.cpython-3?m 相关文件的下载地址啊
|
4
atzlinux 2019-11-19 17:49:12 +08:00
apt reinstall python3-apt
重新安装这个软件包试一下,在 Debian 里面,/usr/lib/python3/dist-packages/apt_pkg.cpython-37m-x86_64-linux-gnu.so 这个文件,是在 python3-apt 软件包里。 |