Possibly fix false positive error message for python package requirements
This commit is contained in:
@@ -11,8 +11,9 @@ def check_requirements(console=False):
|
|||||||
'pyyaml': 'yaml'}
|
'pyyaml': 'yaml'}
|
||||||
missing = []
|
missing = []
|
||||||
for package, import_name in check_packages.items():
|
for package, import_name in check_packages.items():
|
||||||
spec = importlib.util.find_spec(import_name)
|
try:
|
||||||
if spec is None:
|
__import__(import_name)
|
||||||
|
except ImportError:
|
||||||
missing.append(package)
|
missing.append(package)
|
||||||
if len(missing) > 0:
|
if len(missing) > 0:
|
||||||
packages = ','.join(missing)
|
packages = ','.join(missing)
|
||||||
|
|||||||
Reference in New Issue
Block a user