如何使用 Python 3.9.12 解决“错误:无法为 matplotlib 构建轮子,这是安装基于 pyproject.toml 的项目所必需的”?

Dav*_*ood 6 python matplotlib alpine-linux

尝试在 alpine Docker 映像中安装 matplotlib 时遇到以下错误:

 error: Failed to download any of the following: ['http://www.qhull.org/download/qhull-2020-src-8.0.2.tgz'].  Please download one of these urls and extract it into 'build/' at the top-level of the source repository.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for matplotlib
Failed to build matplotlib
ERROR: Could not build wheels for matplotlib, which is required to install pyproject.toml-based projects
Run Code Online (Sandbox Code Playgroud)

我的Python版本是3.9.12。我该如何解决这个错误?

Dav*_*ood 4

这解决了我的问题:

pip install matplotlib==3.2.1
Run Code Online (Sandbox Code Playgroud)