Problems with IPython and interactive mode (OS X, darwinports)

Hi. I just installed ipython and matplotlib on OS X via

    > Darwinports, and both are working well. However, I am
    > getting an error in the interaction between them:

    > $ ipython -pylab pygtk.require() must be called before
    > importing gtk PyGTK version 1.99.16 or greater is
    > required to run the GTK Matplotlib backends

    > It seems odd since I do have a later version of
    > pygtk. Here are (some of) my installed ports:

    > ~ $ port installed The following ports are currently
    > installed:

    > gtk2 @2.8.12_1+darwin_8 (active) py-gtk2 @2.8.4_0
    > (active) py-ipython @0.7.1.fix1_0 (active) py-matplotlib
    > @0.82_0+gtk2 (active) <-- note matplotlib is configured
    > for gtk2

This is pretty old version of matplotlib. You may be seeing some
residual problem between ipython and matplotlib that has long since
been cleared up. If you want to persist with this platform (see
below) you may want to go into site-packages/IPython/Shell.py and
site/packages/matplotlib/backends/backend_gtk.py and manually comment
out any pygtk.require statements.

    > My backend is GTKAgg.

    > In addition, when I run matplotlib in interactive mode,
    > by setting interactive: True in my matplotlib.rc file, it
    > works, but the effects are one step behind. I.e. I can
    > say:

    > plot([1, 2, 3]) (the plotting window appears with nothing
    > in it) xlabel('foo') (the line appears) ylabel('baz')
    > (the xlabel appears)

Is this from a standard python shell? If so, you are probably seeing
some threading weirdness. Only the TkAgg backend works from the
standard python shell. To Use GTK* or WX* you need a properly
threaded shell, eg ipython in pylab mode or a GUI specific shell --
see http://matplotlib.sf.net/interactive.html for more info.

    > In case it helps, here is my pythonpath. Darwinports
    > installs everything into /opt/local

Most people I know (including myself, I'm typing this email from my
powerbook) think that the macpython stuff is the way to go:

  Python Stuff

and

  http://geosci.uchicago.edu/~tobis/pylab.html

Unfortunately, the binary build there is also woefully out of date.

JDH