How can I solve a mathplotlib error on BigSur? My build and version of Big Sur is undetermined. I’m using homebrew which says submit a pull request rather tan ask them for support on prerelease macOS.
I get this:
&gt; pip3 install matplotlib
Collecting matplotlib
  Using cached matplotlib-3.3.2.tar.gz (37.9 MB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python@3.9/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/private/var/folders/1y/2wcx2c056m9d591zqdyv50mw0000gn/T/pip-install-zly4xiti/matplotlib/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'/private/var/folders/1y/2wcx2c056m9d591zqdyv50mw0000gn/T/pip-install-zly4xiti/matplotlib/setup.py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' egg_info --egg-base /private/var/folders/1y/2wcx2c056m9d591zqdyv50mw0000gn/T/pip-pip-egg-info-mafx0kq9
         cwd: /private/var/folders/1y/2wcx2c056m9d591zqdyv50mw0000gn/T/pip-install-zly4xiti/matplotlib/
    Complete output (62 lines):

    Edit setup.cfg to change the build options; suppress output with --quiet.

    BUILDING MATPLOTLIB
      matplotlib: yes [3.3.2]
          python: yes [3.9.0 (default, Oct  6 2020, 04:17:54)  [Clang 12.0.0
                      (clang-1200.0.32.2)]]
        platform: yes [darwin]
     sample_data: yes [installing]
           tests: no  [skipping due to configuration]
          macosx: yes [installing]

    running egg_info
    creating /private/var/folders/1y/2wcx2c056m9d591zqdyv50mw0000gn/T/pip-pip-egg-info-mafx0kq9/matplotlib.egg-info
    writing /private/var/folders/1y/2wcx2c056m9d591zqdyv50mw0000gn/T/pip-pip-egg-info-mafx0kq9/matplotlib.egg-info/PKG-INFO

 ....

      File &quot;/private/var/folders/1y/2wcx2c056m9d591zqdyv50mw0000gn/T/pip-install-zly4xiti/matplotlib/.eggs/numpy-1.19.2-py3.9-macosx-10.15-x86_64.egg/numpy/__init__.py&quot;, line 286, in &lt;module&gt;
        raise RuntimeError(msg)
    RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
    RankWarning: Polyfit may be poorly conditioned

    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I guess the Accelerate backend doesn't work on bigsur, but then how can I install it with another backend?
This issue is not related to Big Sur pre-release version but rather broken matplotlib after Python 3.9 update, the problem exists on Catalina (10.15.7), too:
https://github.com/matplotlib/matplotlib/issues/18678
Most likely missing wheels support in NumPy is causing the issue:
https://github.com/numpy/numpy/issues/17482
Installing older Python version should fix the problem until the problem is fixed on NumPy side. (The current 3.8.x version is 3.8.6).
To install specific Python version please see:
How to install specific version of python on OS X