<h3 dir="auto">Bug summary</h3>
<p dir="auto">distutils is deprecated in Python 3.10: <a href="https://docs.python.org/3/library/distutils.html" rel="nofollow">https://docs.python.org/3/library/distutils.html</a></p>
<p dir="auto">Matplotlib (as of 3.4.3) currently uses <code class="notranslate">distutils</code>, so users are met with <code class="notranslate">DeprecationWarning</code>s when using on Python 3.10.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    from matplotlib import pyplot 
.tox/py/lib/python3.10/site-packages/matplotlib/__init__.py:88: in &lt;module&gt;
    from distutils.version import LooseVersion
/usr/local/lib/python3.10/distutils/__init__.py:19: in &lt;module&gt;
    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"><pre class="notranslate"><code class="notranslate">    from matplotlib import pyplot 
.tox/py/lib/python3.10/site-packages/matplotlib/__init__.py:88: in &lt;module&gt;
    from distutils.version import LooseVersion
/usr/local/lib/python3.10/distutils/__init__.py:19: in &lt;module&gt;
    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></pre></div>
<h3 dir="auto">Code for reproduction</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from matplotlib import pyplot"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">matplotlib</span> <span class="pl-k">import</span> <span class="pl-s1">pyplot</span></pre></div>
<h3 dir="auto">Actual outcome</h3>
<p dir="auto"><code class="notranslate">DeprecationWarning</code> raised per summary.</p>
<h3 dir="auto">Expected outcome</h3>
<p dir="auto">No <code class="notranslate">DeprecationWarning</code>s raised</p>
<h3 dir="auto">Additional information</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">macOS</p>
<h3 dir="auto">Matplotlib Version</h3>
<p dir="auto">3.4.3</p>
<h3 dir="auto">Matplotlib Backend</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Python version</h3>
<p dir="auto">Python 3.10.0</p>
<h3 dir="auto">Jupyter version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Installation</h3>
<p dir="auto">pip</p>
<h3 dir="auto">Bug summary</h3>
<p dir="auto"><a href="https://www.python.org/dev/peps/pep-0632/" rel="nofollow">Python 3.10 formally deprecated distutils.</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives"><pre class="notranslate"><code class="notranslate">DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
</code></pre></div>
<p dir="auto">matplotlib still contains a few occurrences which should probably be removed:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="setup.py:from distutils.errors import CompileError
setup.py:from distutils.dist import Distribution
setup.py:setup(  # Finally, pass this all along to distutils to do the heavy lifting.
setupext.py:from distutils import ccompiler, sysconfig
setupext.py:from distutils.core import Extension
setupext.py:        Return or yield a list of C extensions (`distutils.core.Extension`"><pre class="notranslate"><code class="notranslate">setup.py:from distutils.errors import CompileError
setup.py:from distutils.dist import Distribution
setup.py:setup(  # Finally, pass this all along to distutils to do the heavy lifting.
setupext.py:from distutils import ccompiler, sysconfig
setupext.py:from distutils.core import Extension
setupext.py:        Return or yield a list of C extensions (`distutils.core.Extension`
</code></pre></div>
<h3 dir="auto">Code for reproduction</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="-"><pre class="notranslate"><span class="pl-c1">-</span></pre></div>
<h3 dir="auto">Actual outcome</h3>
<ul dir="auto">
<li></li>
</ul>
<h3 dir="auto">Expected outcome</h3>
<ul dir="auto">
<li></li>
</ul>
<h3 dir="auto">Operating system</h3>
<p dir="auto">Ubuntu</p>
<h3 dir="auto">Matplotlib Version</h3>
<p dir="auto">master</p>
<h3 dir="auto">Matplotlib Backend</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Python version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Jupyter version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Other libraries</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Installation</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Conda channel</h3>
<p dir="auto"><em>No response</em></p>