![尝试运行 lsb_release -a 时出现错误 ModuleNotFoundError: 没有名为“lsb_release”的模块](https://linux22.com/image/783708/%E5%B0%9D%E8%AF%95%E8%BF%90%E8%A1%8C%20lsb_release%20-a%20%E6%97%B6%E5%87%BA%E7%8E%B0%E9%94%99%E8%AF%AF%20ModuleNotFoundError%3A%20%E6%B2%A1%E6%9C%89%E5%90%8D%E4%B8%BA%E2%80%9Clsb_release%E2%80%9D%E7%9A%84%E6%A8%A1%E5%9D%97.png)
尝试在 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