|
From: Liang W. <fra...@gm...> - 2012-08-16 22:50:12
|
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 <module>
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 <ben...@ou...> wrote:
>
>
> On Thu, Aug 16, 2012 at 4:26 PM, Liang Wang <fra...@gm...> 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
>
>
|