[pdfgui bug] I'm not sure what this error is, it pops up as soon as I choose "New Fit"

2 views
Skip to first unread message

dif...@diffpy.org

unread,
Mar 9, 2009, 6:03:39 PM3/9/09
to diffp...@googlegroups.com
reporter: diffuser

summary: I'm not sure what this error is, it pops up as soon as I choose "New Fit"

description:

component: pdfgui

version: 1.0b.1792

traceback: {{{
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy/pdfgui/gui/pdfpanel.py", line 64, in _f
return func(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy/pdfgui/gui/plotpanel.py", line 203, in updateWidgets
self._check(None)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy/pdfgui/gui/plotpanel.py", line 257, in _check
self._plot(None)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy/pdfgui/gui/plotpanel.py", line 240, in _plot
self.mainFrame.control.plot(xval, yvals, refs, shift=offset, dry=(event is None))
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy/pdfgui/control/pdfguicontrol.py", line 527, in plot
from plotter import Plotter
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy/pdfgui/control/plotter.py", line 17, in <module>
from diffpy.pdfgui.gui.extendedplotframe import ExtendedPlotFrame
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy/pdfgui/gui/extendedplotframe.py", line 22, in <module>
matplotlib.use('WXAgg')
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/__init__.py", line 735, in use
raise RuntimeError(_use_error_msg)
RuntimeError: matplotlib.use() must be called *before* pylab
or matplotlib.backends is imported for the first time.
}}}

Pavol Juhas

unread,
Mar 9, 2009, 8:02:02 PM3/9/09
to diffp...@googlegroups.com
On Mon, Mar 09, 2009 at 06:03:39PM -0400, dif...@diffpy.org wrote:
> summary: I'm not sure what this error is, it pops up as soon as
> I choose "New Fit"
>
...

> Traceback (most recent call last):
...

> RuntimeError: matplotlib.use() must be called *before* pylab


Thank you for reporting the problem. We had a similar issue before,
which was fixed in the sources, but these have not been released
yet (we will do a new release in a next few days).
http://groups.google.com/group/diffpy-dev/browse_thread/thread/7cd933a04e0f02aa/9f1b249fa9da1033

In the meantime you can try one of these quick fixes:

(1) in a text editor, open the
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy/pdfgui/gui/extendedplotframe.py
file and replace on line 28
from pylab import setp
with
from matplotlib.artist import setp
This should redo the same change as done in
http://danse.us/trac/diffraction/changeset/1883

(2) If that does not help, open a terminal window and type
"which pdfgui" - this should tell where is the pdfgui starting
script. Open that file in a text editor and add below the
first line

import matplotlib; matplotlib.use('WXAgg')

Make sure the first line (starting with #!) remains the same.


If the problem persists, please start from a terminal window

python -v /path/to/pdfgui 2>pdfgui_import.log

This should create a pdfgui_import.log file with a listing of all
python libraries in an order as they were loaded. Please, email
me that file and I will investigate further.

Good luck, please let me know if this helped.

Pavol

--
Dr. Pavol Juhas
Applied Physics & Applied Mathematics
Columbia University
Room 200 Mudd Building, MC 4701
500 West 120th Street
New York, NY 10027

Jessica Koschmeder

unread,
Apr 1, 2009, 2:21:36 PM4/1/09
to diffpy-dev
I ended up reinstalling numpy and matplotlib and that ended up
resolving this problem. I'm not sure if they were just not installed
right to begin with or they were installed in the wrong order or
something but it worked for me.

~Jessica

On Mar 9, 5:02 pm, Pavol Juhas <pj2...@columbia.edu> wrote:
> On Mon, Mar 09, 2009 at 06:03:39PM -0400, dif...@diffpy.org wrote:
> > summary: I'm not sure what this error is, it pops up as soon as
> > I choose "New Fit"
>
> ...
> > Traceback (most recent call last):
> ...
> > RuntimeError:  matplotlib.use() must be called *before* pylab
>
> Thank you for reporting the problem.  We had a similar issue before,
> which was fixed in the sources, but these have not been released
> yet (we will do a new release in a next few days).http://groups.google.com/group/diffpy-dev/browse_thread/thread/7cd933...
Reply all
Reply to author
Forward
0 new messages