Skip to content

Commit f573043

Browse files
committed
...
1 parent f7156da commit f573043

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pytorch_lightning/utilities/imports.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def _compare_version(package: str, op, version) -> bool:
4848
>>> _compare_version("torch", operator.ge, "0.1")
4949
True
5050
"""
51+
if not _module_available(package):
52+
return False
5153
try:
5254
pkg = importlib.import_module(package)
5355
assert hasattr(pkg, '__version__')

0 commit comments

Comments
 (0)