Re: [Matplotlib-users] Any available backend for non-root users?
Thank you Ben, I did use -X option upon ssh and I am running linux locally. The DISPLAY variable is automatically "localhost:17.0", where the number 17 changes for each login. But Tk would not work even after I export a new value to DISPLAY like ":0.0". I even tried reinstalling matplotlib (from source or through easy_install) with both values of DISPLAY but it always warns that Tk window failed to open. When I try to use TkAgg, it says ... import matplotlib.backends.tkagg as tkagg File "/ccs/home/lag69/.local/lib/python2.7/site-packages/matplotlib-1.1.0-py2.7-linux-x86_64.egg/matplotlib/backends/tkagg.py", line 1, in import _tkagg ImportError: No module named _tkagg So far I haven't solved this problem and I have to generate png files to view them (I can view them by xview or display of ImageMagick so the x11 forwarding does work) This is odd, and I almost lost my patient to try. But I still want to appreciate your generous help, Ben. regards, Liang On Thu, Aug 16, 2012 at 4:54 PM, Benjamin Root wrote: > > > On Thu, Aug 16, 2012 at 4:26 PM, Liang Wang wrote: > >> Hi everyone. I have trouble to find a usable background on a remote >> server where I do not have root privilege. Unfortunately, there is no >> backend available: >> >>Tkinter: no >> * 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. Tkinter present, but header files are >> not >> * found. You may need to install development >> * packages. >> Gtk+: no >> * Building for Gtk+ requires pygtk; you must be >> able >> * to "import gtk" in your build/install >> environment >>Mac OS X native: no >> Qt: no >>Qt4: no >> PySide: no >> Cairo: no >> >> The output of a simple script is >> == >> simple_plot.py: >> # >> from pylab import * >> plot([1,2,3]) >> show() >> # >> python simple_plot.py --verbose-helpful > output.txt >> == >> $HOME=/ccs/home/user1 >> CONFIGDIR=/ccs/home/user1/.matplotlib >> matplotlib data path >> /ccs/home/user1/.local/lib/python2.7/site-packages/matplotlib-1.1.0-py2.7-linux-x86_64.egg/matplotlib/mpl-data >> loaded rc file >> /ccs/home/user1/.local/lib/python2.7/site-packages/matplotlib-1.1.0-py2.7-linux-x86_64.egg/matplotlib/mpl-data/matplotlibrc >> matplotlib version 1.1.0 >> verbose.level helpful >> interactive is False >> platform is linux2 >> Using fontManager instance from /ccs/home/user1/.matplotlib/fontList.cache >> backend agg version v2.2 >> >> When I tried to install pygtk, it requires glib, which is missing, and I >> just did not digg further. So, is there any workaround that I can get ANY >> backend to work (to show images on screen). >> >> >> Any suggestions will be greatly appreciated (I really want to get things >> to work). >> >> Regards, >> Liang >> >> > The Agg backend is always available for non-interactive plotting. In > other words, you won't be able to do a show() call, but you can save to any > of the image formats. The TkAgg backend should also be an option (unless > that python was built without Tk, which is rare). Often, if Tk isn't > working, it is a simple matter of setting your display environment > correctly. Most of the time, simply passing the "-X" option to ssh is > sufficient (assuming you are sshing from a linux box). Otherwise, I think > you have to mess around with your DISPLAY environment variable on the > remote server (I think it is usually ":0.0", but I am no expert on this. > > I hope that helps! > Ben Root > > -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Any available backend for non-root users?
On Thu, Aug 16, 2012 at 4:26 PM, Liang Wang wrote: > Hi everyone. I have trouble to find a usable background on a remote server > where I do not have root privilege. Unfortunately, there is no backend > available: > >Tkinter: no > * 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. Tkinter present, but header files are > not > * found. You may need to install development > * packages. > Gtk+: no > * Building for Gtk+ requires pygtk; you must be > able > * to "import gtk" in your build/install > environment >Mac OS X native: no > Qt: no >Qt4: no > PySide: no > Cairo: no > > The output of a simple script is > == > simple_plot.py: > # > from pylab import * > plot([1,2,3]) > show() > # > python simple_plot.py --verbose-helpful > output.txt > == > $HOME=/ccs/home/user1 > CONFIGDIR=/ccs/home/user1/.matplotlib > matplotlib data path > /ccs/home/user1/.local/lib/python2.7/site-packages/matplotlib-1.1.0-py2.7-linux-x86_64.egg/matplotlib/mpl-data > loaded rc file > /ccs/home/user1/.local/lib/python2.7/site-packages/matplotlib-1.1.0-py2.7-linux-x86_64.egg/matplotlib/mpl-data/matplotlibrc > matplotlib version 1.1.0 > verbose.level helpful > interactive is False > platform is linux2 > Using fontManager instance from /ccs/home/user1/.matplotlib/fontList.cache > backend agg version v2.2 > > When I tried to install pygtk, it requires glib, which is missing, and I > just did not digg further. So, is there any workaround that I can get ANY > backend to work (to show images on screen). > > > Any suggestions will be greatly appreciated (I really want to get things > to work). > > Regards, > Liang > > The Agg backend is always available for non-interactive plotting. In other words, you won't be able to do a show() call, but you can save to any of the image formats. The TkAgg backend should also be an option (unless that python was built without Tk, which is rare). Often, if Tk isn't working, it is a simple matter of setting your display environment correctly. Most of the time, simply passing the "-X" option to ssh is sufficient (assuming you are sshing from a linux box). Otherwise, I think you have to mess around with your DISPLAY environment variable on the remote server (I think it is usually ":0.0", but I am no expert on this. I hope that helps! Ben Root -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Any available backend for non-root users?
Hi everyone. I have trouble to find a usable background on a remote server where I do not have root privilege. Unfortunately, there is no backend available: Tkinter: no * 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. Tkinter present, but header files are not * found. You may need to install development * packages. Gtk+: no * Building for Gtk+ requires pygtk; you must be able * to "import gtk" in your build/install environment Mac OS X native: no Qt: no Qt4: no PySide: no Cairo: no The output of a simple script is == simple_plot.py: # from pylab import * plot([1,2,3]) show() # python simple_plot.py --verbose-helpful > output.txt == $HOME=/ccs/home/user1 CONFIGDIR=/ccs/home/user1/.matplotlib matplotlib data path /ccs/home/user1/.local/lib/python2.7/site-packages/matplotlib-1.1.0-py2.7-linux-x86_64.egg/matplotlib/mpl-data loaded rc file /ccs/home/user1/.local/lib/python2.7/site-packages/matplotlib-1.1.0-py2.7-linux-x86_64.egg/matplotlib/mpl-data/matplotlibrc matplotlib version 1.1.0 verbose.level helpful interactive is False platform is linux2 Using fontManager instance from /ccs/home/user1/.matplotlib/fontList.cache backend agg version v2.2 When I tried to install pygtk, it requires glib, which is missing, and I just did not digg further. So, is there any workaround that I can get ANY backend to work (to show images on screen). Any suggestions will be greatly appreciated (I really want to get things to work). Regards, Liang Relevant info is: output of build: basedirlist is: ['/usr/local', '/usr'] BUILDING MATPLOTLIB matplotlib: 1.1.1 python: 2.7.2 (default, Sep 27 2011, 21:40:17) [GCC 4.3.4 [gcc-4_3-branch revision 152973]] platform: linux2 REQUIRED DEPENDENCIES numpy: 1.6.1 freetype2: 9.18.3 OPTIONAL BACKEND DEPENDENCIES libpng: 1.2.31 Tkinter: no * 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. Tkinter present, but header files are not * found. You may need to install development * packages. Gtk+: no * Building for Gtk+ requires pygtk; you must be able * to "import gtk" in your build/install environment Mac OS X native: no Qt: no Qt4: no PySide: no Cairo: no OPTIONAL DATE/TIMEZONE DEPENDENCIES datetime: present, version unknown dateutil: 1.5 pytz: 2011c OPTIONAL USETEX DEPENDENCIES dvipng: no ghostscript: 8.62 latex: no pdftops: 0.12.3 == [Edit setup.cfg to suppress the above messages] pymods ['pylab'] packages ['matplotlib', 'matplotlib.backends', 'matplotlib.backends.qt4_editor', 'matplotlib.projections', 'matplotlib.testing', 'matplotlib.testing.jpl_units ', 'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist', 'matplotlib.sph inxext', 'matplotlib.tri', 'matplotlib.delaunay'] running build running build_py creating build . warnings of build /usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm /usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm /usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc /usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc src/_ttconv.cpp: In function 'void initttconv()': src/_ttconv.cpp:280:15: warning: variable 'm' set but not used [-Wunused-but-set-variable] ttconv/pprdrv_tt.cpp: In function 'void Read_name(TTFONT*)': ttconv/pprdrv_tt.cpp:182:18: warning: variable 'encoding' set but not used [-Wunused-but-