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 raised under Python 3.10 #6043

Closed
johnthagen opened this issue Nov 16, 2021 · 1 comment · Fixed by #6044
Closed

DeprecationWarning raised under Python 3.10 #6043

johnthagen opened this issue Nov 16, 2021 · 1 comment · Fixed by #6044

Comments

@johnthagen
Copy link
Contributor

johnthagen commented Nov 16, 2021

Description

Way to reproduce

from skimage import exposure

Run with python -Werror using Python 3.10

    from skimage import exposure
.tox/py/lib/python3.10/site-packages/skimage/__init__.py:135: in <module>
    from .data import data_dir
.tox/py/lib/python3.10/site-packages/skimage/data/__init__.py:8: in <module>
    from distutils.version import LooseVersion
/usr/local/lib/python3.10/distutils/__init__.py:19: in <module>
    warnings.warn(_DEPRECATION_MESSAGE,
E   DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives

This code was recently moved in #5996 to:

from distutils.version import LooseVersion

Probably best would be to search for and replace all usages of distutils.

Version information

# Paste the output of the following python commands
from __future__ import print_function
import sys; print(sys.version)
import platform; print(platform.platform())
import skimage; print(f'scikit-image version: {skimage.__version__}')
import numpy; print(f'numpy version: {numpy.__version__}')
  • Python 3.10.0
  • python:3.10 Docker image
  • scikit-image 0.18.3
  • numpy 1.21.4
@grlee77
Copy link
Contributor

grlee77 commented Nov 16, 2021

Thanks @johnthagen, we recently fixed part of this in the main branch (#6007), but a couple of imports of error classes remain. With the recently released setuptools 59 we can remove those as well. I will make a PR to go ahead and do that via a try/except so that we can still fall back to distutils for users with older setuptools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants