Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning: The distutils package is deprecated #2121

Closed
adamjstewart opened this issue Sep 30, 2023 · 1 comment · Fixed by #2137
Closed

DeprecationWarning: The distutils package is deprecated #2121

adamjstewart opened this issue Sep 30, 2023 · 1 comment · Fixed by #2137
Labels
bug / fix Something isn't working help wanted Extra attention is needed v1.0.x v1.1.x v1.2.x

Comments

@adamjstewart
Copy link
Contributor

🐛 Bug

TorchMetrics still uses distutils, but distutils is deprecated.

To Reproduce

> python3 -Wall
>>> import torchmetrics
lib/python3.11/site-packages/torchmetrics/utilities/imports.py:18: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.version import LooseVersion

Expected behavior

I would not expect TorchMetrics to still be using distutils.

Environment

  • TorchMetrics version: 1.1, 1.2, master (spack)
  • Python & PyTorch Version: 3.11.4 & 2.0.1
  • Any other relevant information such as OS: macOS 13.5.2

Additional context

I also sometimes see a different error message from pytest:

DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

This gives one possible solution.

@adamjstewart adamjstewart added bug / fix Something isn't working help wanted Extra attention is needed labels Sep 30, 2023
@Borda
Copy link
Member

Borda commented Oct 1, 2023

seems to be related to Lightning-AI/utilities#119
@adamjstewart would you be interested in sending a fix/upgrade?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / fix Something isn't working help wanted Extra attention is needed v1.0.x v1.1.x v1.2.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants