Skip to content

Commit

Permalink
pytorch#69894: setuptools LooseVersion missing from the latest setupt…
Browse files Browse the repository at this point in the history
…ools, so migrated to using packaging.version.Version.
  • Loading branch information
Tero Keski-Valkama committed Dec 14, 2021
1 parent 51033ec commit fd0207a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ astunparse
expecttest
future
numpy
packaging
psutil
pyyaml
requests
Expand Down
5 changes: 1 addition & 4 deletions torch/utils/tensorboard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import tensorboard
from setuptools import distutils

LooseVersion = distutils.version.LooseVersion
from packaging.version import Version as LooseVersion

if not hasattr(tensorboard, '__version__') or LooseVersion(tensorboard.__version__) < LooseVersion('1.15'):
raise ImportError('TensorBoard logging requires TensorBoard version 1.15 or above')

del distutils
del LooseVersion
del tensorboard

Expand Down

0 comments on commit fd0207a

Please sign in to comment.