|
From: John H. <jdh...@ac...> - 2004-05-24 14:30:49
|
>>>>> "Gary" == Gary Ruben <ga...@em...> writes:
Gary> Hi John, I've now retraced my steps and discovered that
Gary> GTKAgg exhibits the crashing problem but TkAgg seems to
Gary> exhibit a different but maybe related problem.
Gary> I uninstalled 0.53.1 again and confirmed that the old
Gary> \site-packages\matplotlib directory was removed. I'm trying
Gary> the matplotlib-0.54.win32-py2.3.exe version with Numeric and
Gary> the only .matplotlibrc setting changed being backend :
Gary> GTKAgg
>>>> import matplotlib
Gary> returns without complaint but
>>>> import matplotlib.matlab
Gary> generates a pythonw illegal operation dialog with "PYTHONW
Gary> caused an invalid page fault" etc. and causes IDLE generates
Gary> a "================================ RESTART
Gary> ================================" line.
It looks like GUI conflict: GTK versus Idle Tk. This would explain
why TkAgg works but GTKAgg fails. Try running several of the examples
from the examples dir (not in an IDE but from the shell) with -dGTKAgg
and -dTkAgg and see if you have any troubles. If they work fine, at
least we'll have narrowed your trouble down to a GUI conflict. I
don't think you can expect GTK or GTKAgg to work from within IDLE.
Some of these issues are discussed on
http://matplotlib.sourceforge.net/faq.html#SHOW and
http://matplotlib.sourceforge.net/interactive.html
Gary> However, there are problems. For example, I tried running a
Gary> previously working plot script from SciTE and it now
Gary> generates an abnormal program termination MSVC++ Runtime
Gary> library error from pythonw.exe prior to a page fault. This
Gary> time, python generates something: Fatal Python error:
Gary> PyEval_RestoreThread: NULL tstate
>> Process failed to respond; forcing abrupt termination...
I believe SciTE is a GTK based IDE, so you may not want to issue
"show" since this can get you into mainloop conflicts or threading
problems. I'm not 100% sure what happens when you call gtk.mainloop
twice from the same program, which is effectively what I think you be
doing if you called show from within scite.
Try doing this at the end of your script (this is a GTK / GTKAgg
specific option:
show(mainloop=False)
which will realize your figures w/o starting the mainloop, and
*should* work within a program where the pygtk mainloop is already
started. I don't know enough about scite to know if this will work or
not. The other thing that might happen is that nothing will show at
all (if scite is not pygtk). My guess is you will no longer get the
thread error, in which case at least we'll have learned something.
JDH
|