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


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

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)
      (the line appears)
      (the xlabel appears)


Any ideas what might be going wrong?

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

~ $ python
Python 2.4.2 (#1, Mar 31 2006, 13:50:42)
[GCC 4.0.0 (Apple Computer, Inc. build 5026)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print '\n'.join(sys.path)