Hi,
I have two questions, I'll ask the simple one first. I migrated from Matlab
to Octave which uses gnuplot and thus provides 3D plotting capability, which
is adequate. Matplotlib is 2D, are there any good 3D plotters out there for
python?
Second question: I can't install Matplotlib and maybe someone will have seen
the symptom before or have some bright ideas to help me figure it out. I'm
running SuSE 9.1, python 2.3.3, and seem to have Tcl/Tk/Tkinter installed OK.
For example:
#!/usr/bin/env python
from Tkinter import *
root = Tk()
w = Label(root, text="Hello, world!")
w.pack()
root.mainloop()
does the right thing by bringing up a window with the text.
$PYTHONHOME = /usr
I set BUILD_GTKAGG = 0 in setup.py. In an xterm as root I ran this and the
output follows
\start
# python setup.py build
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
Using default library and include directories for Tcl and Tk because a
Tk window failed to open. You may need to define DISPLAY for Tk to work
so that setup can determine where your libraries are located.
running build
running build_py
creating build
creating build/lib.linux-i686-2.3
copying lib/pylab.py -> build/lib.linux-i686-2.3
creating build/lib.linux-i686-2.3/matplotlib
copying lib/matplotlib/patches.py -> build/lib.linux-i686-2.3/matplotlib
copying lib/matplotlib/_image.py -> build/lib.linux-i686-2.3/matplotlib
... etc copying a bunch of files into the build directory
copying lib/pytz/zoneinfo/Africa/Tripoli.py ->
build/lib.linux-i686-2.3/pytz/zoneinfo/Africa
copying lib/pytz/zoneinfo/Africa/Banjul.py ->
build/lib.linux-i686-2.3/pytz/zoneinfo/Africa
running build_ext
building 'matplotlib._nc_transforms' extension
creating build/temp.linux-i686-2.3
creating build/temp.linux-i686-2.3/src
creating build/temp.linux-i686-2.3/CXX
gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64
-DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall
-fPIC -Isrc -I. -I/usr/include/python2.3 -c CXX/IndirectPythonInterface.cxx
-o build/temp.linux-i686-2.3/CXX/IndirectPythonInterface.o -DNUMERIC=1
gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64
-DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall
-fPIC -Isrc -I. -I/usr/include/python2.3 -c CXX/cxxsupport.cxx -o
build/temp.linux-i686-2.3/CXX/cxxsupport.o -DNUMERIC=1
gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64
-DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall
-fPIC -Isrc -I. -I/usr/include/python2.3 -c src/_nc_transforms.cpp -o
build/temp.linux-i686-2.3/src/_nc_transforms.o -DNUMERIC=1
In file included from /usr/include/python2.3/Python.h:8,
from CXX/Objects.hxx:9,
from CXX/Extensions.hxx:18,
from src/_transforms.h:12,
from src/_nc_transforms.cpp:2:
/usr/include/python2.3/pyconfig.h:847:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/g++/i586-suse-linux/bits/os_defines.h:39,
from /usr/include/g++/i586-suse-linux/bits/c++config.h:35,
from /usr/include/g++/functional:53,
from src/_nc_transforms.cpp:1:
/usr/include/features.h:131:1: warning: this is the location of the previous
definition
gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64
-DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall
-fPIC -Isrc -I. -I/usr/include/python2.3 -c CXX/cxxextensions.c -o
build/temp.linux-i686-2.3/CXX/cxxextensions.o -DNUMERIC=1
gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64
-DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall
-fPIC -Isrc -I. -I/usr/include/python2.3 -c src/mplutils.cpp -o
build/temp.linux-i686-2.3/src/mplutils.o -DNUMERIC=1
gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64
-DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall
-fPIC -Isrc -I. -I/usr/include/python2.3 -c CXX/cxx_extensions.cxx -o
build/temp.linux-i686-2.3/CXX/cxx_extensions.o -DNUMERIC=1
g++ -pthread -shared build/temp.linux-i686-2.3/src/_nc_transforms.o
build/temp.linux-i686-2.3/src/mplutils.o
build/temp.linux-i686-2.3/CXX/cxx_extensions.o
build/temp.linux-i686-2.3/CXX/cxxsupport.o
build/temp.linux-i686-2.3/CXX/IndirectPythonInterface.o
build/temp.linux-i686-2.3/CXX/cxxextensions.o -lstdc++ -lm -o
build/lib.linux-i686-2.3/matplotlib/_nc_transforms.so
building 'matplotlib.backends._tkagg' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=64
-DHAVE_LARGEFILE_SUPPORT -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall
-fPIC -I/usr/local/include -I/usr/local/include -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/local/include/freetype2
-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/include/python2.3 -c src/_tkagg.cpp -o
build/temp.linux-i686-2.3/src/_tkagg.o
g++ -pthread -shared build/temp.linux-i686-2.3/src/_tkagg.o -L/usr/local/lib
-L/usr/local/lib -L/usr/local/lib -L/usr/lib -L/usr/local/lib -L/usr/lib -ltk
-ltcl -lpng -lz -lstdc++ -lm -lfreetype -lz -lstdc++ -lm -o
build/lib.linux-i686-2.3/matplotlib/backends/_tkagg.so
/linux1/usr/bin/../lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld:
cannot find -ltk
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1
\end
I'm figuring the "Tk window open failed" bit at the start is just because it
seems to take a few seconds for Tk windows to appear on my system, and its
not coded to wait. So assuming that's not fatal, it seems the problem boils
down to "cannot find -ltk". I have searched for a few hours on google to no
avail. The only things I can suspect are maybe:
- I might be missing some installed components for development stuff in Tcl or
g++?
- Maybe need to have some environment variables set (e.g. for Tk?)
- Have some sort of path mismatch where it's looking for something that is
somewhere else?
I've compiled a few things successfully on this set up now and not come across
this one, any thoughts appreciated.
Cheers
Jason