Firstly, congratulations on matplotlib - a great tool.
I thought I would share with you the problems I have had (and overcome) with installing matplotlib
on my computer (which runs Linux with many packages taken from source).
The short version, is that I could not simply run
python setup.py build
but instead had to run:
sed -e "s@...*linux2.*@ 'linux2' : ['/usr/local', '/usr',],@" setupext.py >newsetupext.py
mv newsetupext.py setupext.py
sudo mv /usr/local/include/pygtk /usr/local/include/pygtk-1.2
CC=g++ python setup.py build
sudo mv /usr/local/include/pygtk-1.2 /usr/local/include/pygtk
I have things like fontconfig installed in /usr/local, so had to add /usr/local to the path
(explaining the sed).
I also have both pygtk1.2 (0.6.11) and pygtk2.2 (2.2.0), including the header files. Since pygtk1.2
installs its header files in /usr/local/include/pygtk, and pygtk2.2 in /usr/local/include/pygtk-2.0,
adding /usr/local/include/pygtk-2.0 to the include path and then including pygtk seems to pick up
the pygtk1.2 header files rather than the pygtk subdirectory of /usr/local/include/pygtk-2.0
(explaining the mv's).
Lastly, I needed to explicitly inform python distutils that it is compiling c++ (explaining the
CC=g++ environment variable).
So that this list is searchable, the kind of problems solved by the above were:
/usr/local/include/ft2build.h:56: freetype/config/ftheader.h: No such file or directory
src/ft2font.c: In function `newFT2FontObject':
src/ft2font.c:171: parse error before `*'
and an inability to use the GTKAgg backend because it was compiled against the wrong headers
(complaining at runtime that it could not import _gtk).
Anyway, I hope this is helpful to someone, and sorry if it has been discussed before etc (I only
have a slow dial-up link and browsing sourceforge mailing lists is painful.)
From: John Hunter <jdhunter@ac...> - 2004-05-10 13:07:45
>>>>> "Timoth" == <timothy@...> writes:
Timoth> I have things like fontconfig installed in /usr/local, so
Timoth> had to add /usr/local to the path (explaining the sed).
I think it is sensible to add /usr/local before /usr in the search
path - not sure why I didn't do it before.
Timoth> I also have both pygtk1.2 (0.6.11) and pygtk2.2 (2.2.0),
Timoth> including the header files. Since pygtk1.2 installs its
Timoth> header files in /usr/local/include/pygtk, and pygtk2.2 in
Timoth> /usr/local/include/pygtk-2.0, adding
Timoth> /usr/local/include/pygtk-2.0 to the include path and then
Timoth> including pygtk seems to pick up the pygtk1.2 header files
Timoth> rather than the pygtk subdirectory of
Timoth> /usr/local/include/pygtk-2.0 (explaining the mv's).
This surprises me, because pkg-config is supposed to handle this since
we explicitly ask for pygtk-2. Not sure how to handle this -
hopefully not too many folks have such an old pygtk installed!
Timoth> Lastly, I needed to explicitly inform python distutils
Timoth> that it is compiling c++ (explaining the CC=g++
Timoth> environment variable).
Also surprising since distutils is supposed to detect the extension
and pick the right compiler. What version of python and gcc are you
using? Does it help to rename all the src/*.cpp files to *.cxx?
You'll have to edit setupext.py if you test this.
Thanks for the detailed notes,