–
modules = ["pywin32", "pandas", "matplotlib"] # 替换为你要检查的模块名
for module_name in modules:
try:
version = pkg_resources.get_distribution(module_name).version
print(f"{module_name} version: {version}")
except pkg_resources.DistributionNotFound:
print(f"{module_name} is not installed.")
–
发表回复