python - 即使安装了所有必需的软件包,Matplotlib 也没有安装

标签 python matplotlib freetype

我是一名 Mac 用户,试图安装此特定版本的 matplotlib,但我不断收到此错误。我已确定我有所需的包裹,但不确定如何确保它们位于正确的位置。目前,我无法使绘图适用于我正在处理的各种代码。以下错误:

pip3 install matplotlib==3.0.3
Collecting matplotlib==3.0.3
Using cached matplotlib-3.0.3.tar.gz (36.6 MB)
ERROR: Command errored out with exit status 1:
 command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/g5/20g6q1l91sd1v97fz778n5wr0000gp/T/pip-install-yozx599p/matplotlib/setup.py'"'"'; __file__='"'"'/private/var/folders/g5/20g6q1l91sd1v97fz778n5wr0000gp/T/pip-install-yozx599p/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/g5/20g6q1l91sd1v97fz778n5wr0000gp/T/pip-install-yozx599p/matplotlib/pip-egg-info
     cwd: /private/var/folders/g5/20g6q1l91sd1v97fz778n5wr0000gp/T/pip-install-yozx599p/matplotlib/
Complete output (44 lines):
IMPORTANT WARNING:
    pkg-config is not installed.
    matplotlib may not be able to find some of its dependencies
============================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [3.0.3]
                python: yes [3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019,
                        10:23:27)  [Clang 6.0 (clang-600.0.57)]]
              platform: yes [darwin]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.16.2]
      install_requires: yes [handled by setuptools]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: no  [The C/C++ header for freetype2 (ft2build.h)
                        could not be found.  You may need to install the
                        development package.]
                   png: yes [pkg-config information for 'libpng' could not
                        be found. Using unknown version found on system.]
                 qhull: yes [pkg-config information for 'libqhull' could not
                        be found. Using local copy.]

OPTIONAL SUBPACKAGES
           sample_data: yes [installing]
              toolkits: yes [installing]
                 tests: no  [skipping due to configuration]
        toolkits_tests: no  [skipping due to configuration]

OPTIONAL BACKEND EXTENSIONS
                   agg: yes [installing]
                 tkagg: yes [installing; run-time loading from Python Tcl /
                        Tk]
                macosx: yes [installing, darwin]
             windowing: no  [Microsoft Windows only]

OPTIONAL PACKAGE DATA
                  dlls: no  [skipping due to configuration]

============================================================================
                        * The following required packages can not be built:
                        * freetype
----------------------------------------

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



'''

最佳答案

如日志所述,您可能需要安装模块 freetype 才能使其正常工作。确保尝试一下,看看错误是否不会返回。

关于python - 即使安装了所有必需的软件包,Matplotlib 也没有安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60628662/

相关文章:

python - 将多个不同长度的时间序列合并成一个二维矩阵

python - 使用 Pandas 从字符串列表中提取某些元素并转换为日期时间

c++ - OpenGL、FreeType2 : italic characters overlay each other

opengl - 如何使正字法文本始终显示/最顶部?

c - FreeType 库和 "Undefined reference to FT_Init_FreeType"

Python - 使用 matplotlib 组织 3 个子图

python - 如何获取所有列的平均值并存储到新行中

python - `ValueError: operands could not be broadcast together` 尝试使用 Seaborn 从 DataFrame 列绘制单变量分布时

python - 用python平滑线条路径

python - 在 Python Matplotlib 中绘制静态生命游戏模式