2013-02-06 58 views
1

嘗試構建Python3的matplotlib時遇到以下錯誤。我已經安裝了Numpy和Scipy(包括調試擴展)。我也安裝了libpng12-0和libfreetype6(和調試),但仍然沒有。Matplotlib ft2font生成錯誤(python3)

運行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 

[email protected]:~/Downloads/matplotlib$ sudo find/-name "ft2font*" 
/home/tom/Downloads/matplotlib/src/ft2font.cpp 
/home/tom/Downloads/matplotlib/src/ft2font.h 
[email protected]:~/Downloads/matplotlib$ 

我似乎無法利用它多大意義,因爲它似乎無法找到在src/ft2font *文件,但是當我尋找他們。 ,他們肯定存在。我錯過了什麼?

謝謝!

+0

它看起來像你缺少'Python.h'。你有沒有安裝python3-dev軟件包? – tacaswell

+0

排序問題,我錯過了python3-dev!什麼是這是缺少的包裹的指標?如果你作爲一個完整的答案作出迴應,我將接受並讓業力下雨! – Tomassino

回答

1

它看起來像你缺少Python.h。你有沒有安裝python3-dev軟件包?

該指示是找不到的文件是Python.h

In file included from ./CXX/Extensions.hxx:37:0,<-- (2) an include file in (1) 
       from src/ft2font.h:6, <-- (1) an include file in (0) 
       from src/ft2font.cpp:3: <-- (0) file gcc was trying to compile 
./CXX/WrapPython.h:58:20: fatal error: Python.h: No such file or directory 
^(3) an include in (2) with error ^the actually missing file 

Python.h爲蟒dev的報頭。如果您不知道丟失的標題所屬的包是什麼,您可以檢查包裝中是否有發行版,其中大多數包含「按文件名搜索」功能。例如the ubuntu package listing