尝试运行 lsb_release -a 时出现错误 ModuleNotFoundError: 没有名为“lsb_release”的模块

尝试运行 lsb_release -a 时出现错误 ModuleNotFoundError: 没有名为“lsb_release”的模块

尝试在 Debian 上运行 lsb_release 时看到以下输出:

(venv) vm-1671541226:/$ 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'

Debian版本:10.12 Python版本:3.9.14

根据 apt-get 它在那里:

(venv) vm-1671541226:/$ sudo apt-get install lsb-release
Reading package lists... Done
Building dependency tree       
Reading state information... Done
lsb-release is already the newest version (10.2019051400).
The following packages were automatically installed and are no longer required:
  fonts-dejavu libyelp0 python-apt-common python3-apt python3-distro-info yelp-xsl
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 187 not upgraded.

然后我尝试重新安装它但仍然出现同样的错误。

答案1

解决方案解释如下这一页,可以帮助您解决问题:

你可能只需要使用特定版本的 Python 3

相关内容