1

Experiencing the following error when trying to build matplotlib for Python3. I have installed Numpy and Scipy already (including debug extensions). I have also installed libpng12-0 and libfreetype6 (and debug) but still nothing.

After running python3 setup.py build I get the following:

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$ 

I can't seem to make much sense of it, as it seems to fail finding the src/ft2font.* files but when I search for them, they are definitely present. What am I missing?

Thanks!

asked Feb 6, 2013 at 14:42
2
  • It looks like you are missing Python.h. Do you have the python3-dev package installed? Commented Feb 6, 2013 at 14:43
  • That sorted the problem, I was missing python3-dev! What is the indicator that this is the missing package? If you respond as a full answer I shall accept and let the karma rain! Commented Feb 6, 2013 at 14:53

1 Answer 1

1

It looks like you are missing Python.h. Do you have the python3-dev package installed?

The indication is that the file that is not found is 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 is the dev header for python. If you do not know what package a missing header belongs to, you can check the packaging for you distro, most of them have a 'search by filename' functionality. Ex the ubuntu package listing.

answered Feb 6, 2013 at 15:10
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.