From: Tom L. <lo...@as...> - 2005-01-31 22:07:23
|
Hi folks- I had some trouble installing matplotlib on a machine running Fedora Core 3 and Python 2.3.4. I eventually got it to work, and thought I'd pass on my experiences in case (1) they might be helpful to other FC3 users, and (2) I may have overlooked something that an FC3 expert can point out. I should note that I have two Pythons on this machine; Fedora's is in /usr/bin, and I keep the one I use myself in /usr/local/bin, so I can update it without fear of interfering with Fedora's Python (standard Redhat/Fedora procedure, I believe). Here's the symptom: "python setup.py build" always quits as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~ gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -Isrc -Iagg22/include -I. -I/usr/local/include -I/usr/include -I/usr/local/include/freetype2 -I/usr/include/freetype2 -Isrc/freetype2 -Iagg22/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/local/include/python2.3 -c src/_gtkagg.cpp -o build/temp.linux-i686-2.3/src/_gtkagg.o cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ In file included from /usr/local/include/python2.3/Python.h:8, from /usr/include/pygtk-2.0/pygobject.h:5, from src/_gtkagg.cpp:8: /usr/local/include/python2.3/pyconfig.h:850:1: warning: "_POSIX_C_SOURCE" redefined In file included from /usr/include/string.h:26, from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:51, from src/_gtkagg.cpp:1: /usr/include/features.h:150:1: warning: this is the location of the previous definition In file included from src/_gtkagg.cpp:8: /usr/include/pygtk-2.0/pygobject.h:140: error: expected `,' or `...' before "typename" /usr/include/pygtk-2.0/pygobject.h:147: error: expected `,' or `...' before "typename" error: command 'gcc' failed with exit status 1 ~~~~~~~~~~~~~~~~~~~~~~ This looks like a problem with the pytgtk installation. So I tried installing pygtk from source. First I tried the latest/greatest version, 2.5.3, just posted on the pygtk site. It requires a newer version of the GTK+ libraries than is included in FC3. I tried installing these (first GLib, then Pango, ATK and GTK+) but couldn't get past GLib. By default these install in /usr/local. FC3 comes with them in /usr. What little I could find online indicates that it is a BAD THING to have a newer version sitting in /usr/local, and that the best procedure is to stick with the current version or install any updates from RPMs. (It was not recommended that one overwrite the FC3 installation via ./configure --prefix=/usr.) I could not find FC3 RPMs for the latest GTK+, so I gave up on that, and deleted all the GTK stuff I had installed in /usr/local. Next I tried the previous stable version of pygtk, 2.4.1. The install went fine, but a subsequent attempt at installing matplotlib duplicated the problem noted above. However, pygtk installs into /usr/local by default, and FC3 comes with it in /usr, and matplotlib was having a problem with the /usr version. (Sure enough, a "diff" shows the newer version I had in /usr/local has pygobject.h modified.) So I *reinstalled* 2.4.1 into /usr using # ./configure --prefix=/usr Now matplotlib builds fine. I have copies of pygtk in both /usr and /usr/local; I'm not sure if that will cause me problems. As root, my shell runs /usr/local/bin/python; I suspect /usr/bin/python may have an incompatible pygtk site-package at this point, but I haven't pursued this since I don't use the FC3 python version myself. If FC3 experts out there can identify a problem with this procedure, please let me know! Thanks, Tom Loredo ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ |