首页 > 解决方案 > High Sierra 上的 Matplotlib 2.2.2 安装错误

问题描述

我正在运行 Mac OS 10.13.5 并努力在 Python 3.7 上安装 Matplotlib,非常感谢任何帮助。

这是我使用 pip3 install matplotlib 时遇到的错误:

BUILDING MATPLOTLIB
            matplotlib: yes [2.2.2]
                python: yes [3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018,
                        23:26:24)  [Clang 6.0 (clang-600.0.57)]]
              platform: yes [darwin]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.14.5]
      install_requires: yes [handled by setuptools]
                libagg: yes [Requires patches that have not been merged
                        upstream. 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 [version 1.6.34]

但是我已经通过 Homebrew 安装并链接了 freetype:

Ocean-Gypsys-MacBook-Pro:~ Aysegul$ more /usr/X11/lib/pkgconfig/freetype2.pc
prefix=/opt/X11
exec_prefix=/opt/X11
libdir=/opt/X11/lib
includedir=/opt/X11/include

Name: FreeType 2
URL: http://freetype.org
Description: A free, high-quality, and portable font engine.
Version: 18.6.12
Requires:
Requires.private:
Libs: -L${libdir} -lfreetype
Libs.private: -lz -lbz2
Cflags: -I${includedir}/freetype2
/usr/X11/lib/pkgconfig/freetype2.pc (END)

标签: matplotlibmacos-high-sierrafreetypepython-3.7

解决方案


推荐阅读