summary: Still wants to call pylab before matplotlib.use
description: I've just installed the prereleased version of pdfgui and this error is still coming up even though the code in extendedplotframe.py was already correct.
component: pdfgui
version: 1.0c1.dev-r2837-20090310
traceback:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy.pdfgui-1.0c1.dev_r2837_20090310-py2.5.egg/diffpy/pdfgui/gui/errorwrapper.py", line 60, in _f
return func(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy.pdfgui-1.0c1.dev_r2837_20090310-py2.5.egg/diffpy/pdfgui/gui/plotpanel.py", line 207, in updateWidgets
self._check(None)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy.pdfgui-1.0c1.dev_r2837_20090310-py2.5.egg/diffpy/pdfgui/gui/plotpanel.py", line 268, in _check
self._plot(None)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy.pdfgui-1.0c1.dev_r2837_20090310-py2.5.egg/diffpy/pdfgui/gui/plotpanel.py", line 245, 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-1.0c1.dev_r2837_20090310-py2.5.egg/diffpy/pdfgui/control/pdfguicontrol.py", line 530, in plot
from diffpy.pdfgui.control.plotter import Plotter
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy.pdfgui-1.0c1.dev_r2837_20090310-py2.5.egg/diffpy/pdfgui/control/plotter.py", line 18, in <module>
from diffpy.pdfgui.gui.extendedplotframe import ExtendedPlotFrame
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/diffpy.pdfgui-1.0c1.dev_r2837_20090310-py2.5.egg/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.
Hi Jessica,
Sorry about all the problems with getting pdfgui running. I checked
the code carefully and I am at loss why is this happening - pdfgui
does not even import pylab at all.
Please start pdfgui from a terminal using
python -v `which pdfgui` 2>pdfgui_import.log
and repeat the steps that caused the bug. This will write
a list of pdfgui imports to pdfgui_import.log - after you exit
the gui, send that file to my email address.
One more thing - if you are using C-style shell (csh or tcsh) the
command above would not work, you need to start it from either
sh, bash or zsh.
Good luck,
Pavol
--
Dr. Pavol Juhas
Applied Physics & Applied Mathematics
Columbia University
Room 200 Mudd Building, MC 4701
500 West 120th Street
New York, NY 10027
The error was due to incorrect installation of the matplotlib library
on a MAC computer. The issue was resolved after re-installing
numpy and matplotlib. I am not sure what caused the incorrect
installation, but I would recommend to install external dependencies
in the order of (1) numpy, (2) wxPython, (3) matplotlib.
Hope this helps,
Pavol