[yt-users] Installation script issue with pygtk

Matthew Turk matthewturk at gmail.com
Mon Dec 6 14:29:45 PST 2010


Hi all,

Sorry to chime in after all the activity is dead, but I believe Andrew
is completely correct -- this is just another symptom of how providing
cross-platform, cross-toolkit GUIs is a difficult (even broken)
process, and Agg is the only really reliable plotting solution.  The
availability of GTK, Qt, Tk and so forth, let alone the wrappers on
top of those underlying toolkits, is not guaranteed, and installing
these platforms along with their long list of dependencies is not an
easy task for an isolated installation script.  (This is why tools
like VisIt and ParaView typically spend so much time on packaging!)

Once upon a time in the west we tried supplying wxPython with yt,
which would enable the usage of the wxAgg backend for Matplotlib, but
it became too burdensome to maintain, and it never worked properly.
Having now written several GUIs for yt, none of which really worked in
the long run, I personally believe that there's only really one way
forward with the current state of the technology.  This is going to be
a combination of a webserver tunneled over ssh and local display (in a
web browser) of a standard Python prompt with the ability to create
small widgets for data exploration.  Maintaining a large GUI that
lives on top of the scripting interface is a difficult problem, and I
think it's unreasonable to expect it to be both maintainable and
complete.

I've built a couple prototypes of a purely HTML GUI, but I don't
expect to be able to roll these into the main distribution until
sometime in the early part of next year.  The idea would be that you
open an ssh tunnel to a remote machine, you hit your local port and
your web browser talks to yt.  Within this you'd be able to access the
scripting interface and spawn individual widgets for things like image
panning, volume rendering, editing transfer functions and so on, and
then view the results directly in the browser without having to
forward toolkit-displayed graphics through an X11 session.  This seems
to me to be the only mechanism we can guarantee a user interface
experience that doesn't rely on remote systems having a set of
dependencies that are frankly quite uncommon at most supercomputer
deployments.  In this model, the UI would be very small, require no
compile-time dependencies, and could be *much* more easily maintained.

Anyway, sorry about the rant, and I'm very sorry that the standard iyt
interactive plotting did not work -- but your concerns aren't falling
on deaf ears, and hopefully in the medium-future we can roll something
out that will work for interactive, exploratory analysis without
adding any installation complexity.

If anybody wants to help out with this, beta test, or has experience
with JavaScript/HTML/ExtJS/AJAX, I'd be *really* eager to chat with
you.  I've got a public hg repo with my initial attempts in it which
I'm also happy to share.  Email me off-list and I'll send the URL and
some info on how to start out.

Best wishes,

Matt

On Mon, Dec 6, 2010 at 1:59 PM, Andrew Myers <atmyers at berkeley.edu> wrote:
> Hi Chris,
>
> I've seen this before when trying to build yt on my machine. If the
> matplotlib installer can't find tcl/tk on your machine, it won't be able to
> build Tkinter. You'll need to install tcl/tk and re-run the yt install
> script.
>
> You should be able to use yt with the 'Agg' backend even if you don't do
> this. You won't be able to view figures interactively, but you will be able
> to save .png files to look at later. This is probably the default backend,
> which is why moving the matplotlibrc file allowed you to start iyt.
>
> Andrew Myers
>
> On Mon, Dec 6, 2010 at 1:13 PM, Chris Malone <chris.m.malone at gmail.com>
> wrote:
>>
>> A followup:
>>
>> I tried the install script on a different machine and it installed fine.
>> I then went back to my original machine and mv'ed the
>> ~/.matplotlib/matplotlibrc file out of the way and the ipython session
>> started properly with iyt.
>>
>> So something in my matplibrc file is causing the crash, but the only
>> warning I received was that the numerix param was obsolete.  I tried just
>> commenting out that particular line in the matplotlibrc file but I still
>> recieve the same errors as before.  Any ideas what else in the matplotlibrc
>> file could be causing the crash?
>>
>> Chris
>>
>> On Mon, Dec 6, 2010 at 3:46 PM, Chris Malone <chris.m.malone at gmail.com>
>> wrote:
>>>
>>> Hi Jeff,
>>>
>>> Thanks for the quick response.  Changing this in my
>>> ~/.matplotlib/matplotlibrc file results in:
>>> $ iyt
>>>
>>> /home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/matplotlib/rcsetup.py:117:
>>> UserWarning: rcParams key "numerix" is obsolete and has no effect;
>>>  please delete it from your matplotlibrc file
>>>   warnings.warn('rcParams key "numerix" is obsolete and has no effect;\n'
>>> Traceback (most recent call last):
>>>   File "/home/cmalone/install/yt/yt-x86_64/bin/iyt", line 7, in <module>
>>>     execfile(__file__)
>>>   File "/home/cmalone/install/yt/yt-x86_64/src/yt-hg/scripts/iyt", line
>>> 32, in <module>
>>>     ip_shell = IPython.Shell.IPShellMatplotlib(user_ns=namespace)
>>>   File
>>> "/home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/IPython/Shell.py",
>>> line 1106, in __init__
>>>     shell_class=MatplotlibShell)
>>>   File
>>> "/home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/IPython/Shell.py",
>>> line 73, in __init__
>>>     debug=debug,shell_class=shell_class)
>>>   File
>>> "/home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/IPython/ipmaker.py",
>>> line 100, in make_IPython
>>>     embedded=embedded,**kw)
>>>   File
>>> "/home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/IPython/Shell.py",
>>> line 627, in __init__
>>>     user_ns,user_global_ns,b2 =
>>> self._matplotlib_config(name,user_ns,user_global_ns)
>>>   File
>>> "/home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/IPython/Shell.py",
>>> line 556, in _matplotlib_config
>>>     import matplotlib.pylab as pylab
>>>   File
>>> "/home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/matplotlib/pylab.py",
>>> line 259, in <module>
>>>     from matplotlib.pyplot import *
>>>   File
>>> "/home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/matplotlib/pyplot.py",
>>> line 95, in <module>
>>>     new_figure_manager, draw_if_interactive, show = pylab_setup()
>>>   File
>>> "/home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/matplotlib/backends/__init__.py",
>>> line 25, in pylab_setup
>>>     globals(),locals(),[backend_name])
>>>   File
>>> "/home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py",
>>> line 8, in <module>
>>>     import Tkinter as Tk, FileDialog
>>>   File
>>> "/home/cmalone/install/yt/yt-x86_64/lib/python2.6/lib-tk/Tkinter.py", line
>>> 39, in <module>
>>>     import _tkinter # If this fails your Python may not be configured for
>>> Tk
>>> ImportError: No module named _tkinter
>>>
>>> The install script that I attached before listed "no" for the Tkinter,
>>> wxPython and Gtk+ OPTIONAL BACKEND DEPENDENCIES when trying to build
>>> matplotlib.
>>>
>>> Chris
>>>
>>>
>>> On Mon, Dec 6, 2010 at 3:17 PM, j s oishi <jsoishi at gmail.com> wrote:
>>>>
>>>> Hi Chris,
>>>>
>>>> Could you try switching the backend in your .matplotlibrc file to
>>>> TkAgg? yt may not install all the GUI backends matplotlib can support,
>>>> but it should work with TkAgg straight out of the box.
>>>>
>>>> thanks,
>>>>
>>>> jeff
>>>>
>>>> On Mon, Dec 6, 2010 at 11:52 AM, Chris Malone <chris.m.malone at gmail.com>
>>>> wrote:
>>>> > Hi,
>>>> >
>>>> > Im running on a Fedora 9, 64-bit local desktop:
>>>> >
>>>> > $ uname -r 2.6.27.25-78.2.56.fc9.x86_64
>>>> >
>>>> > I used the install script for both the current stable release as well
>>>> > as the
>>>> > development release.  Both scripts completed without any errors.  I
>>>> > wanted
>>>> > to try the Quick Start instructions to play with the iyt interface.
>>>> > Below
>>>> > is what happens for both cases (after prepending the appropriate
>>>> > environment
>>>> > variables):
>>>> >
>>>> > $ iyt
>>>> >
>>>> > /home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/matplotlib/rcsetup.py:117:
>>>> > UserWarning: rcParams key "numerix" is obsolete and has no effect;
>>>> >  please delete it from your matplotlibrc file
>>>> >   warnings.warn('rcParams key "numerix" is obsolete and has no
>>>> > effect;\n'
>>>> > Traceback (most recent call last):
>>>> >   File "/home/cmalone/install/yt/yt-x86_64/bin/iyt", line 7, in
>>>> > <module>
>>>> >     execfile(__file__)
>>>> >   File "/home/cmalone/install/yt/yt-x86_64/src/yt-hg/scripts/iyt",
>>>> > line 30,
>>>> > in <module>
>>>> >     ip_shell = ipbackends[bend](user_ns=namespace)
>>>> >   File
>>>> >
>>>> > "/home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/IPython/Shell.py",
>>>> > line 1116, in __init__
>>>> >     shell_class=MatplotlibMTShell)
>>>> >   File
>>>> >
>>>> > "/home/cmalone/install/yt/yt-x86_64/lib/python2.6/site-packages/IPython/Shell.py",
>>>> > line 775, in __init__
>>>> >     import gtk
>>>> > ImportError: No module named gtk
>>>> >
>>>> >
>>>> > It therefore appears (and see example install log below) that pygtk
>>>> > was not
>>>> > installed or detected.  Is this working as intended, such that the
>>>> > install
>>>> > script doesn't include the GUI backend information?  Or is is
>>>> > something on
>>>> > my end that is not working properly?  The install script mentions if
>>>> > you
>>>> > have problems with wxPython you should set INST_WXPYTHON=0, but I
>>>> > don't see
>>>> > anything specific about Gtk and I didn't have any wxPython issues
>>>> > other than
>>>> > the installer not finding it when trying to install matplotlib (again
>>>> > see
>>>> > install log).
>>>> >
>>>> > In other words, it appears that the install script isn't completely
>>>> > creating
>>>> > a "fully isolated Python installation with the dependencies you need
>>>> > to run
>>>> > yt," unless there are some options I need to pass to matplotlib via
>>>> > the
>>>> > MPL_SUPP_* flags?
>>>> >
>>>> > If it helps at all, I do have a Python 2.5.1 global installation,
>>>> > which has
>>>> > access to matplotlib, NumPy, wxPython, Tkinter, and Gtk.  Would it be
>>>> > easier
>>>> > to install by hand and just point to the appropriate locations of
>>>> > these
>>>> > libraries?  If so, which versions of HDF5, NumPy, Matplotlib and
>>>> > wxPython
>>>> > are required? (only versions of Python are specified at
>>>> > http://yt.enzotools.org/doc/installation.html#installing-by-hand
>>>> >
>>>> >
>>>> > -------------- yt_install.log attached ----------------
>>>> >
>>>> > Chris
>>>> >
>>>> > _______________________________________________
>>>> > yt-users mailing list
>>>> > yt-users at lists.spacepope.org
>>>> > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>> >
>>>> >
>>>> _______________________________________________
>>>> yt-users mailing list
>>>> yt-users at lists.spacepope.org
>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>



More information about the yt-users mailing list