尝试为 Python3 构建 matplotlib 时遇到以下错误。我已经安装了 Numpy 和 Scipy(包括调试扩展)。我还安装了 libpng12-0 和 libfreetype6 (和调试),但仍然没有。
运行后python3 setup.py build
我得到以下信息:
running build_ext
building 'matplotlib.ft2font' extension
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -DPYCXX_PYTHON_2TO3=1 -I/usr/local/include -I/usr/include -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/usr/include/python3.2mu -c src/ft2font.cpp -o build/temp.linux-i686-3.2/src/ft2font.o
In file included from ./CXX/Extensions.hxx:37:0,
from src/ft2font.h:6,
from src/ft2font.cpp:3:
./CXX/WrapPython.h:58:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
tom@dev-Optiplex:~/Downloads/matplotlib$ sudo find / -name "ft2font*"
/home/tom/Downloads/matplotlib/src/ft2font.cpp
/home/tom/Downloads/matplotlib/src/ft2font.h
tom@dev-Optiplex:~/Downloads/matplotlib$
我似乎无法理解它,因为它似乎无法找到 src/ft2font.* 文件,但是当我搜索它们时,它们肯定存在。我错过了什么?
谢谢!