Skip to content

[Bug]: DeprecationWarning triggered from using distutils #21643

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

Closed
johnthagen opened this issue Nov 15, 2021 · 3 comments
Closed

[Bug]: DeprecationWarning triggered from using distutils #21643

johnthagen opened this issue Nov 15, 2021 · 3 comments

Comments

@johnthagen
Copy link
Contributor

Bug summary

distutils is deprecated in Python 3.10: https://docs.python.org/3/library/distutils.html

Matplotlib (as of 3.4.3) currently uses distutils, so users are met with DeprecationWarnings when using on Python 3.10.

    from matplotlib import pyplot 
.tox/py/lib/python3.10/site-packages/matplotlib/__init__.py:88: 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

Code for reproduction

from matplotlib import pyplot

Actual outcome

DeprecationWarning raised per summary.

Expected outcome

No DeprecationWarnings raised

Additional information

No response

Operating system

macOS

Matplotlib Version

3.4.3

Matplotlib Backend

No response

Python version

Python 3.10.0

Jupyter version

No response

Installation

pip

@dstansby
Copy link
Member

Thanks for reporting. I think this is a duplicate of #21057, which has been fixed.

@johnthagen
Copy link
Contributor Author

Yes, it does appear that this particular import is gone in main:

import atexit
from collections import namedtuple
from collections.abc import MutableMapping
import contextlib
import functools
import importlib
import inspect

@johnthagen
Copy link
Contributor Author

johnthagen commented Nov 15, 2021

Fixed in #20437 (5 months ago?)

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

No branches or pull requests

2 participants