Skip to content

Commit

Permalink
use packaging instead of distutils
Browse files Browse the repository at this point in the history
  • Loading branch information
stargaser committed Jun 8, 2022
1 parent de84d6c commit 5a93414
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 00-Install_and_Setup/check_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
% python check_env.py
"""
from distutils.version import LooseVersion
from packaging.version import Version

# NOTE: Update minversion values as needed.
# This should match environment.yml file.
Expand Down Expand Up @@ -51,8 +51,8 @@ def check_package(package_name, minimum_version=None, verbose=True):
else:
installed_version = pkg.__version__
if (minimum_version is not None and
LooseVersion(installed_version) <
LooseVersion(str(minimum_version))):
Version(installed_version) <
Version(str(minimum_version))):
print(f'Error: {package_name} version {minimum_version} or '
f'later is required, you have version {installed_version}')
errors = True
Expand Down

0 comments on commit 5a93414

Please sign in to comment.