Possibly fix false positive error message for python package requirements

This commit is contained in:
codemann8
2025-04-16 01:19:51 -05:00
parent bce49b9e76
commit 63f39c5c05

View File

@@ -11,8 +11,9 @@ def check_requirements(console=False):
'pyyaml': 'yaml'}
missing = []
for package, import_name in check_packages.items():
spec = importlib.util.find_spec(import_name)
if spec is None:
try:
__import__(import_name)
except ImportError:
missing.append(package)
if len(missing) > 0:
packages = ','.join(missing)