Python 3.x 如何使用pip安装matplotlib

Python 3.x 如何使用pip安装matplotlib,python-3.x,matplotlib,pip,Python 3.x,Matplotlib,Pip,如何使用pip安装matplotlib。我已尝试使用pip安装或从源代码安装 顺便说一句,我有python 3.9测试版 git clone git@github.com:matplotlib/matplotlib.git cd matplotlib python -mpip install . 但是我得到了以下错误 $pip install matplotlib Collecting matplotlib Using cached matplotlib-3.3.2.tar.gz (37.

如何使用pip安装matplotlib。我已尝试使用
pip安装
或从源代码安装 顺便说一句,我有python 3.9测试版

git clone git@github.com:matplotlib/matplotlib.git
cd matplotlib
python -mpip install .
但是我得到了以下错误

$pip install matplotlib
Collecting matplotlib
  Using cached matplotlib-3.3.2.tar.gz (37.9 MB)
    ERROR: Command errored out with exit status 1:
     command: /Users/a/.pyenv/versions/3.9.0b5/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/k0/3v16x2k52tdf00j6tpm7wffc0000gp/T/pip-install-vq_esy_g/matplotlib/setup.py'"'"'; __file__='"'"'/private/var/folders/k0/3v16x2k52tdf00j6tpm7wffc0000gp/T/pip-install-vq_esy_g/matplotlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/k0/3v16x2k52tdf00j6tpm7wffc0000gp/T/pip-pip-egg-info-ny9shc_k
         cwd: /private/var/folders/k0/3v16x2k52tdf00j6tpm7wffc0000gp/T/pip-install-vq_esy_g/matplotlib/
    Complete output (63 lines):
    WARNING: The wheel package is not available.

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

    BUILDING MATPLOTLIB
      matplotlib: yes [3.3.2]
          python: yes [3.9.0b5 (default, Oct  2 2020, 00:38:55)  [Clang 11.0.3
                      (clang-1103.0.32.29)]]
        platform: yes [darwin]
     sample_data: yes [installing]
           tests: no  [skipping due to configuration]
          macosx: yes [installing]

    running egg_info
...
      File "/private/var/folders/k0/3v16x2k52tdf00j6tpm7wffc0000gp/T/pip-install-vq_esy_g/matplotlib/setupext.py", line 469, in add_numpy_flags
        import numpy as np
      File "/private/var/folders/k0/3v16x2k52tdf00j6tpm7wffc0000gp/T/pip-install-vq_esy_g/matplotlib/.eggs/numpy-1.19.2-py3.9-macosx-10.15-x86_64.egg/numpy/__init__.py", line 286, in <module>
        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.
$pip安装matplotlib
收集matplotlib
使用缓存的matplotlib-3.3.2.tar.gz(37.9 MB)
错误:命令出错,退出状态为1:
命令:/Users/a/.pyenv/versions/3.9.0b5/bin/python3.9-c'import sys,setuptools,tokenize;sys.argv[0]=“private/var/folders/k0/3v16x2k52tdf00j6tpm7wffc0000gp/T/pip-install-vq_esy_g/matplotlib/setup.py”__文件“'/private/var/folders/k0/3v16x2k52tdf00j6tpm7wffc0000gp/T/pip-install-vq_esy_g/matplotlib/setup.py'”;f=getattr(标记化,“'open'”,open)(\uuuuu文件);code=f.read().replace(“\r\n”“”、“\n”“”);f、 close();exec(编译(代码,“‘exec’”)‘蛋’信息——蛋基/private/var/folders/k0/3v16x2k52tdf00j6tpm7wffc0000gp/T/pip-pip-egg-info-ny9shc
cwd:/private/var/folders/k0/3v16x2k52tdf00j6tpm7wffc0000gp/T/pip-install-vq_esy_g/matplotlib/
完整输出(63行):
警告:车轮组件不可用。
编辑setup.cfg以更改构建选项;使用--quiet抑制输出。
构建MATPLOTLIB
matplotlib:是[3.3.2]
python:yes[3.9.0b5(默认值,2020年10月2日,00:38:55)[Clang 11.0.3
(叮当声-1103.0.32.29)]]
平台:是[达尔文]
样本数据:是[安装]
测试:否[由于配置原因而跳过]
macosx:是[安装]
运行蛋_信息
...
文件“/private/var/folders/k0/3v16x2k52tdf00j6tpm7wffc0000gp/T/pip-install-vq_esy_g/matplotlib/setupext.py”,第469行,在add_numpy_标志中
将numpy作为np导入
文件“/private/var/folders/k0/3v16x2k52tdf00j6tpm7wffc0000gp/T/pip-install-vq_esy_g/matplotlib/.eggs/numpy-1.19.2-py3.9-macosx-10.15-x86_64.egg/numpy/_init_.py”,第286行,in
引发运行时错误(msg)
运行时错误:Polyfit健全性测试发出警告,很可能是由于使用了错误的加速后端。如果您自己编译,请参阅site.cfg.example以了解信息。否则,请向提供NumPy的供应商报告。
兰克瓦宁:Polyfit可能条件较差
----------------------------------------
错误:命令出错,退出状态为1:python setup.py egg_info检查日志以获得完整的命令输出。

由于您的python版本是3.9,因此可以使用pip3安装matplotlib

pip3 install matplotlib
你也可以试试

python3 -m pip3 install -U matplotlib
编辑

您可能没有正确安装安装工具,请尝试:

pip install --upgrade setuptools

然后
pip安装matplotlib

因为您的python版本是3.9,所以可以使用pip3安装matplotlib

pip3 install matplotlib
你也可以试试

python3 -m pip3 install -U matplotlib
编辑

您可能没有正确安装安装工具,请尝试:

pip install --upgrade setuptools

然后
pip安装matplotlib

我正在使用pyenv控制我的python版本$python——版本=>Python3.9.0b5Oh ok
python-m pip安装-U matplotlib不起作用?我正在使用pyenv控制我的python版本$python——版本=>Python3.9.0b5Oh ok
python-mpip安装-U matplotlib
不起作用?