[SciPy-user] Re: Enthought python

Fernando Perez Fernando.Perez at colorado.edu
Wed Jul 20 11:07:17 CDT 2005

Ryan Krauss wrote:
> Thanks again.  Running Ipython without any switches gets rid of that error.
> I normally run Ipython with the -pylab switch for 2d plotting.  It would 
> be great not to have to run seperate sessions for 2d and 3d 
> visualization.  Is there any way we can make this work with the -pylab 
> switch?

The problem is that mayavi is a Tk app, and you probably have GTK, WX or Qt as 
your pylab backend.  That means conflicting thread models (unless you are in 
debian, where the libs have enough thread support that ipython can make them 
all dance together).

When you use -pylab, ipython will magically configure its threading model to 
match your ~/.matplotlibrc choice.  But when you run mayavi, you'll have 
problems.  The easiest solution (which is what I use, given that I need both 
matplotlib and mayavi) is to run matplotlib with the TkAgg backend as your 
default.  In that case you gain:

- no threading conflicts of any kind (everything is Tk)

- the ability to stop a long computation via Ctrl-C.  This can't be done with 
any of the other backends, because the code and the interface have to run in 
different threads and there is no way in python to send signals across threads.



More information about the SciPy-user mailing list