解决:ModuleNotFoundError: No module named ‘lsb_release‘

项目场景:

终端输入如下指令报错:

lsb_release -c

问题描述

报错:

Traceback (most recent call last):
  File "/usr/bin/lsb_release", line 25, in <module>
    import lsb_release
ModuleNotFoundError: No module named 'lsb_release'

原因分析:

使用命令查看报错详情

lsb_release -a   

报错信息如下:

Traceback (most recent call last):
  File "/usr/bin/lsb_release", line 25, in <module>    # 这个路径很重要
    import lsb_release
ModuleNotFoundError: No module named 'lsb_release'

解决方案:

将系统完整的lsb_release.py文件拷贝到报错的目录文件下即可

sudo cp /usr/lib/python3/dist-packages/lsb_release.py /usr/bin/

你可能感兴趣的:(软件安装,配置,bug,Linux,lsb_release,ubuntu)