我想知道是否可以使用python3(实际上是3.8)知道是否在我的机器上安装了软件包(例如net-tools)。我尝试使用apt库(在PyCharm中),但下载时出现错误:
Collecting apt
Could not find a version that satisfies the requirement apt (from versions: )
No matching distribution found for apt
为什么不简单使用:
import os
os.system('dpkg -l|grep net-tools')