From: Jason H. <hoo...@me...> - 2005-03-21 08:58:51
|
Todd, Thanks, your suggestion prodded me in the right direction, a good old=20 permission issue. It's all working now. Am pasting my notes below. Jason I tried the remedies suggested here: http://lists.debian.org/debian-user/1998/09/msg00113.html (xhost +localhost) and here: http://lists.debian.org/debian-user/1998/08/msg03179.html (use ssh which takes care of the $DISPLAY enviro variable) In the second I no longer got the two lines at the top of the build output: Xlib: connection to ":0.0" refused by server Xlib: Invalid MIT-MAGIC-COOKIE-1 key But everything else went exactly the same. So then I decided to: # chmod -R a+rwx * within the untarred Matplotlib installation root (/matplotlib-0.72.1), to o= pen=20 up the permissions. After again setting BUILD_GTKAGG=3D0 in setup.py I the= n=20 ran: > python setup.py build as my normal (non-root) user and it went perfectly. Since my python=20 installation is in /usr/lib/python which requires root privileges to create= =20 directories etc, I then su'd and from the same directory: # python setup.py install and it transferred the files etc. as desired to the python installation. I= =20 then had to change /usr/share/matplotlib/.matplotlibrc: \snip #### CONFIGURATION BEGINS HERE backend : GTKAgg # the default backend numerix : Numeric # Numeric or numarray interactive : False # see=20 http://matplotlib.sourceforge.net/interactive.html toolbar : toolbar2 # None | classic | toolbar2 timezone : UTC # a pytz timezone string, eg US/Central or=20 Europe/Paris \snip so that the backend was set to 'TKAgg' and interactive set to 'True'. It=20 didn't like 'TKAgg', it needs 'TkAgg'. I confirmed operation with: python>>> from pylab import * python>>> plot([1,2,3]) python>>> [<matplotlib.lines.Line2D instance at 0x40479a2c>] and the Tk window comes up and is zoomable etc. Looks good, looks like the= =20 effort might be worth it!=20 On Saturday 19 March 2005 00:23, Todd Miller wrote: > On Fri, 2005-03-18 at 05:02, Jason Hoogland wrote: > > 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/Tkint= er > > installed OK. > > > > I set BUILD_GTKAGG =3D 0 in setup.py. In an xterm as root I ran this a= nd > > 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 > > [mostly snipped] > > > 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-s= us > >e-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 becau= se > > it seems to take a few seconds for Tk windows to appear on my system, a= nd > > its not coded to wait. > > That "Tk window open failed" problem looks to me like it may be *the* > problem. matplotlib opens a Tk window to help figure out where Tk is; > the fallback isn't working. In your case I think the Tk window failed > because "root" is trying to open a window on a display owned by your > non-priviledged account. Having the system say "no" to root about > anything is really counter intuitive to me, but I've experienced it > myself and it's discussed some here: > > http://lists.debian.org/debian-user/1998/09/msg00113.html > > The article suggests that if you do > > % xhost +localhost > > in your non-priviledged account before trying to build as root, X will > allow the Tk window open. > > > 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. On my RHEL3 system, I have tk-devel-8.3.5-92.2 installed. > > Hope this helps, > Todd =2D-=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D Jason Hoogland =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0h...@me... Doctoral student =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ph(= w) +61 7 3365 4457 Centre for Hypersonics =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ph(mob) +61 413 30= 0 887 The University of Queensland =C2=A0 =C2=A0UTC+10 Brisbane QLD 4072, Australia =C2=A0 =C2=A0http://www.marsgravity.org =2D--------------------------------------------------------- |