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.
}}}
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