matplotlib: no interactive backends appear to work
In macports, matplotlib is not working quite like I'd like. I've installed it for both python24 and python25. It appears the dependencies aren't quite right (sufficient) so I have manually installed a few packages besides the normal dependencies; this bears further investigation but I'd have to uninstall a bunch of things to properly test it out so I'll leave that alone for now. Anyway: I'd like this package to work with the large variety of backends that matplotlib supports, so I am going through them now to point out issues with the current install. This is the current MacPorts (1.6) with 10.5.1 on Intel (MacBook Pro) and the latest portfiles. Summary: No interactive backends work at all. I'm not asking for every backend to work, but at least some of them would be nice. I'd think about prioritizing TkAgg and making sure that pdf in 2.5 also works. First, I've installed both python24 and python25: $ port installed | grep matplotlib py-matplotlib @0.90.1_0+numpy+tkinter (active) py25-matplotlib @0.90.1_1+numpy+tkinter (active) I can configure the backend by setting it in ~/.matplotlib/matplotlibrc. That is the only setting I have in this file, so everything else is default. I am testing this with 'test.py', the simplest possible matplotlib program: from pylab import * plot([1,2,3,4]) show() # for interactive, or savefig('test') for file and running with python2.4 test.py (or python2.5 test.py). OK, let's start looking at backends. First, the file-saving backends, then the interactive ones. ++++++++ backend: Pdf ++++++++ 2.4: Writes pdf correctly (woo hoo!). 2.5: Fails with AttributeError: 'module' object has no attribute 'decoding_map' $ python2.5 test.py Traceback (most recent call last): File "test.py", line 4, in <module> savefig('test') File "/opt/local/lib/python2.5/site-packages/matplotlib/pylab.py", line 796, in savefig return fig.savefig(*args, **kwargs) File "/opt/local/lib/python2.5/site-packages/matplotlib/figure.py", line 759, in savefig self.canvas.print_figure(*args, **kwargs) File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 1395, in print_figure file.close() File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 401, in close self.writeFonts() File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 456, in writeFonts fontdictObject = self.embedTTF(filename) File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 508, in embedTTF widths = [ get_char_width(charcode) for charcode in range(firstchar, lastchar+1) ] File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 505, in get_char_width unicode = cp1252.decoding_map[charcode] or 0 AttributeError: 'module' object has no attribute 'decoding_map' ++++++++ backend: Ps ++++++++ Appears to write both ps and eps correctly for both 2.4 and 2.5. ++++++++ backend: Svg ++++++++ Appears to write svg correctly for both 2.4 and 2.5 (openable in Firefox). Interactive backends: ++++++++ backend: Agg ++++++++ 2.4 and 2.5: Launches and completes, does not pop up any graph (window) as it should. ++++++++ backend: Cairo ++++++++ 2.4 and 2.5: Same behavior, 'ImportError: No module named cairo' Traceback (most recent call last): File "test.py", line 1, in ? from pylab import * File "/opt/local/lib/python2.4/site-packages/pylab.py", line 1, in ? from matplotlib.pylab import * File "/opt/local/lib/python2.4/site-packages/matplotlib/pylab.py", line 222, in ? new_figure_manager, draw_if_interactive, show = pylab_setup() File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/backend_cairo.py", line 27, in ? import cairo ImportError: No module named cairo $ port installed | grep -i cairo cairo @1.4.10_0 cairo @1.4.12_0 cairo @1.4.14_0 (active) ++++++++ backend: CocoaAgg ++++++++ $ python2.4 test.py The CococaAgg backend required PyObjC to be installed! (currently testing v1.3.7) $ python2.5 test.py The CococaAgg backend required PyObjC to be installed! (currently testing v1.3.7) ++++++++ backend: FltkAgg ++++++++ 2.4 and 2.5: Same behavior, 'ImportError: No module named fltk' Traceback (most recent call last): File "test.py", line 1, in ? from pylab import * File "/opt/local/lib/python2.4/site-packages/pylab.py", line 1, in ? from matplotlib.pylab import * File "/opt/local/lib/python2.4/site-packages/matplotlib/pylab.py", line 222, in ? new_figure_manager, draw_if_interactive, show = pylab_setup() File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/backend_fltkagg.py", line 15, in ? import fltk as Fltk ImportError: No module named fltk ++++++++ backend: Gtk AND GtkAgg ++++++++ 2.4 and 2.5: Same behavior, 'ImportError: No module named gobject' Traceback (most recent call last): File "test.py", line 1, in ? from pylab import * File "/opt/local/lib/python2.4/site-packages/pylab.py", line 1, in ? from matplotlib.pylab import * File "/opt/local/lib/python2.4/site-packages/matplotlib/pylab.py", line 222, in ? new_figure_manager, draw_if_interactive, show = pylab_setup() File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py", line 10, in ? from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\ File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py", line 6, in ? import gobject ImportError: No module named gobject ++++++++ backend: GtkCairo ++++++++ 2.4 and 2.5: Same behavior, 'ImportError: No module named gtk' Traceback (most recent call last): File "test.py", line 1, in ? from pylab import * File "/opt/local/lib/python2.4/site-packages/pylab.py", line 1, in ? from matplotlib.pylab import * File "/opt/local/lib/python2.4/site-packages/matplotlib/pylab.py", line 222, in ? new_figure_manager, draw_if_interactive, show = pylab_setup() File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtkcairo.py", line 5, in ? import gtk ImportError: No module named gtk ++++++++ backend: QtAgg ++++++++ 2.4 and 2.5: Same behavior, 'ImportError: No module named qt Traceback (most recent call last): File "test.py", line 1, in ? from pylab import * File "/opt/local/lib/python2.4/site-packages/pylab.py", line 1, in ? from matplotlib.pylab import * File "/opt/local/lib/python2.4/site-packages/matplotlib/pylab.py", line 222, in ? new_figure_manager, draw_if_interactive, show = pylab_setup() File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/backend_qtagg.py", line 13, in ? from backend_qt import qt, FigureManagerQT, FigureCanvasQT,\ File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/backend_qt.py", line 20, in ? import qt ImportError: No module named qt ++++++++ backend: Qt4Agg ++++++++ 2.4 and 2.5: Same behavior, 'ImportError: No module named PyQt4' Traceback (most recent call last): File "test.py", line 1, in <module> from pylab import * File "/opt/local/lib/python2.5/site-packages/pylab.py", line 1, in <module> from matplotlib.pylab import * File "/opt/local/lib/python2.5/site-packages/matplotlib/pylab.py", line 222, in <module> new_figure_manager, draw_if_interactive, show = pylab_setup() File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_qt4agg.py", line 14, in <module> from backend_qt4 import QtCore, QtGui, FigureManagerQT, FigureCanvasQT,\ File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_qt4.py", line 20, in <module> from PyQt4 import QtCore, QtGui ImportError: No module named PyQt4 ++++++++ backend: TkAgg ++++++++ 2.4: Launches X, pops up a blank window labeled Figure 1, segfaults python. 2.5: Traceback (most recent call last): File "test.py", line 1, in <module> from pylab import * File "/opt/local/lib/python2.5/site-packages/pylab.py", line 1, in <module> from matplotlib.pylab import * File "/opt/local/lib/python2.5/site-packages/matplotlib/pylab.py", line 222, in <module> new_figure_manager, draw_if_interactive, show = pylab_setup() File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_tkagg.py", line 7, in <module> import Tkinter as Tk, FileDialog File "/opt/local/lib/python2.5/lib-tk/Tkinter.py", line 38, in <module> import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter ++++++++ backend: Wx ++++++++ $ python2.4 test.py Matplotlib backend_wx requires wxPython be installed $ python2.5 test.py This program needs access to the screen. Please run with 'pythonw', not 'python', and only when you are logged in on the main display of your Mac. $ pythonw2.4 test.py Matplotlib backend_wx requires wxPython be installed $ pythonw2.5 test.py Traceback (most recent call last): File "test.py", line 1, in <module> from pylab import * ImportError: No module named pylab ++++++++ backend: WxAgg ++++++++ $ python2.4 test.py Traceback (most recent call last): File "test.py", line 1, in ? from pylab import * File "/opt/local/lib/python2.4/site-packages/pylab.py", line 1, in ? from matplotlib.pylab import * File "/opt/local/lib/python2.4/site-packages/matplotlib/pylab.py", line 222, in ? new_figure_manager, draw_if_interactive, show = pylab_setup() File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/backend_wxagg.py", line 19, in ? import wx ImportError: No module named wx $ python2.5 test.py This program needs access to the screen. Please run with 'pythonw', not 'python', and only when you are logged in on the main display of your Mac. $ pythonw2.4 test.py Traceback (most recent call last): File "test.py", line 1, in ? from pylab import * File "/opt/local/lib/python2.4/site-packages/pylab.py", line 1, in ? from matplotlib.pylab import * File "/opt/local/lib/python2.4/site-packages/matplotlib/pylab.py", line 222, in ? new_figure_manager, draw_if_interactive, show = pylab_setup() File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/backend_wxagg.py", line 19, in ? import wx ImportError: No module named wx $ pythonw2.5 test.py Traceback (most recent call last): File "test.py", line 1, in <module> from pylab import * ImportError: No module named pylab /* end of message */
On 26.01.2008, at 18:29, John Owens wrote:
In macports, matplotlib is not working quite like I'd like.
[...] Hi John, this looks like a heroic effort, but I agree that these things should work;) Then GTKagg works for me with python25, at least mostly. I used to have a plain GTK with python24 and at that time it simply worked. Now I have python25 and gtk2 (with variant quartz) installed and GTKagg essentially works, although the rubberband for zooming is iffy and similar glitches occur. On rubberband usage I get the following messages in the terminal: Sat Jan 26 21:59:32 koelsch python[1379] <Error>: CGBitmapContextGetBitsPerPixel: invalid context I wish you all the luck and success you want and look forward to all the improvements we can get;) Greetings, Jochen -- Einigkeit und Recht und Freiheit http://www.Jochen-Kuepper.de Liberté, Égalité, Fraternité GnuPG key: CC1B0B4D Sex, drugs and rock-n-roll
On Jan 26, 2008, at 6:29 PM, John Owens wrote:
port installed | grep matplotlib py-matplotlib @0.90.1_0+numpy+tkinter (active) py25-matplotlib @0.90.1_1+numpy+tkinter (active)
The variant "tkinter" is the default and the only one you have installed: the other backends cannot work because you haven't installed their dependencies yet (i.e. py25-cairo). As for the recent version 2.5 of Tkinter, there is a working patch which has been committed for the the py-tkinter port but not yet for the py25-tkinter one (http://trac.macports.org/projects/macports/changeset/13929). All the other problems with py25-gtk should have been solved already. - Guido
Guido Soranzio <guido.soranzio <at> gmail.com> writes:
The variant "tkinter" is the default and the only one you have installed: the other backends cannot work because you haven't installed their dependencies yet (i.e. py25-cairo).
I installed py25-cairo and now it runs the script without error but nothing happens (no popup graph, no file produced). Would it be helpful to have a port of some kind that did all the dependencies for all the backends, or an easier way to say 'please install the following backend'. I still don't get any interactive backends doing anything at all, including tk, though I'm happy I can get ps output. JDO
On Jan 27, 2008, at 12:42 AM, John Owens wrote:
I still don't get any interactive backends doing anything at all, including tk.
There is a problem with py25-tkinter since it has not been synced yet with the new Tk 8.5. I reported and cc'ed to mww@macports.org a simple patch more than 72 hours ago, so I hope he won’t mind if I commit it now: <http://trac.macports.org/projects/macports/changeset/33426>- When you run from python2.5 import Tkinter t = Tkinter.Tk() a window should open now instead of the previous error message: "RuntimeError: tk.h version (8.5) doesn't match libtk.a version (8.4)". - Guido
Guido Soranzio <guido.soranzio <at> gmail.com> writes:
import Tkinter t = Tkinter.Tk()
a window should open now instead of the previous error message:
I confirm this fix works for me (in fact I made the same fix myself to get Tk working earlier :) ), and the window does open in this test. However, what backend does this correspond to? I still get errors when running Gtk or TkAgg. JDO
Jochen Küpper <jochen <at> fhi-berlin.mpg.de> writes:
Then GTKagg works for me with python25, at least mostly.
I installed gtk2, py-gtk2, py25-gtk hoping that would help. Alas. All of the gtk backends fail with 'no module named _ns_backend_gdk'. Also as best I can tell, py-gtk2 and py25-gtk can't coexist. JDO classico 180$ python2.5 test.py Traceback (most recent call last): File "test.py", line 1, in <module> from pylab import * File "/opt/local/lib/python2.5/site-packages/pylab.py", line 1, in <module> from matplotlib.pylab import * File "/opt/local/lib/python2.5/site-packages/matplotlib/pylab.py", line 222, in <module> new_figure_manager, draw_if_interactive, show = pylab_setup() File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_gtkcairo.py", line 10, in <module> from matplotlib.backends.backend_gtk import * File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py", line 21, in <module> from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_gdk.py", line 35, in <module> from matplotlib.backends._ns_backend_gdk import pixbuf_get_pixels_array ImportError: No module named _ns_backend_gdk classico 181$ python2.5 test.py Traceback (most recent call last): File "test.py", line 1, in <module> from pylab import * File "/opt/local/lib/python2.5/site-packages/pylab.py", line 1, in <module> from matplotlib.pylab import * File "/opt/local/lib/python2.5/site-packages/matplotlib/pylab.py", line 222, in <module> new_figure_manager, draw_if_interactive, show = pylab_setup() File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py", line 21, in <module> from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_gdk.py", line 35, in <module> from matplotlib.backends._ns_backend_gdk import pixbuf_get_pixels_array ImportError: No module named _ns_backend_gdk classico 182$ python2.5 test.py Traceback (most recent call last): File "test.py", line 1, in <module> from pylab import * File "/opt/local/lib/python2.5/site-packages/pylab.py", line 1, in <module> from matplotlib.pylab import * File "/opt/local/lib/python2.5/site-packages/matplotlib/pylab.py", line 222, in <module> new_figure_manager, draw_if_interactive, show = pylab_setup() File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_gtkagg.py", line 10, in <module> from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\ File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py", line 21, in <module> from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_gdk.py", line 35, in <module> from matplotlib.backends._ns_backend_gdk import pixbuf_get_pixels_array ImportError: No module named _ns_backend_gdk
On Jan 27, 2008 12:07 AM, John Owens <john_owens@yahoo.com> wrote:
I installed gtk2, py-gtk2, py25-gtk hoping that would help. Alas. All of the gtk backends fail with 'no module named _ns_backend_gdk'. Also as best I can tell, py-gtk2 and py25-gtk can't coexist.
I've just updated the Portfile to 0.91.2, can you try the various backends with this version? The TKAgg backend works for me. Cheers Adam
Adam Mercer <ram <at> macports.org> writes:
I've just updated the Portfile to 0.91.2, can you try the various backends with this version? The TKAgg backend works for me.
Can't get tkinter installed since it conflicts with wxpython (see below) in 2.5, which seems to be default (and doesn't react to -wxpython). So py25-matplotlib isn't installed with tkinter. Anyway, using show() and backend : TkAgg on either python 2.4 or 2.5 pops up a blank X window and then segfaults python. Here's what I have installed: $ port installed | grep matplotlib py-matplotlib @0.90.1_0+numpy+tkinter py-matplotlib @0.91.2_0+tkinter (active) py25-matplotlib @0.90.1_1+gtk2+numpy py25-matplotlib @0.90.1_1+numpy+tkinter py25-matplotlib @0.90.1_1+numpy+wxpython py25-matplotlib @0.91.2_0+cairo+wxpython (active) Also I get a pile of Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION _FUNCTIONALITY___YOU_MUST_EXEC__() to debug. The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). during compiles. JDO $ sudo port -d upgrade py25-matplotlib +cairo +tkinter -wxpython DEBUG: variants to install {} numpy wxpython DEBUG: available variants are : universal cairo gtk2 tkinter wxpython DEBUG: variant wxpython is present in py25-matplotlib 0.91.2_0 DEBUG: new portvariants: wxpython + tkinter + cairo + DEBUG: Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/release/ports/python/ py25-matplotlib DEBUG: Requested variant darwin is not provided by port py25-matplotlib. DEBUG: Requested variant i386 is not provided by port py25-matplotlib. DEBUG: Requested variant macosx is not provided by port py25-matplotlib. DEBUG: Executing variant cairo provides cairo DEBUG: Executing variant tkinter provides tkinter Error: Variant tkinter conflicts with wxpython DEBUG: Error evaluating variants while executing "error "Error evaluating variants"" (procedure "mportopen" line 51) invoked from within "mportopen $porturl [array get options] [array get variations]" Error: Unable to open port: Error evaluating variants
On Jan 28, 2008 11:19 AM, John Owens <john_owens@yahoo.com> wrote:
Can't get tkinter installed since it conflicts with wxpython (see below) in 2.5, which seems to be default (and doesn't react to -wxpython). So py25-matplotlib isn't installed with tkinter.
Anyway, using show() and backend : TkAgg on either python 2.4 or 2.5 pops up a blank X window and then segfaults python. Here's what I have installed:
$ port installed | grep matplotlib py-matplotlib @0.90.1_0+numpy+tkinter py-matplotlib @0.91.2_0+tkinter (active) py25-matplotlib @0.90.1_1+gtk2+numpy py25-matplotlib @0.90.1_1+numpy+tkinter py25-matplotlib @0.90.1_1+numpy+wxpython py25-matplotlib @0.91.2_0+cairo+wxpython (active)
Also I get a pile of
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION _FUNCTIONALITY___YOU_MUST_EXEC__() to debug. The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
during compiles.
This is an issue with tcl, you need to configure tcl with --disable-corefoundation - I've informed tcl's maintainer
$ sudo port -d upgrade py25-matplotlib +cairo +tkinter -wxpython
tkinter is a default variant so you don't need to specify +tkinter, also wxpython is disabled by default so again you don't need to specify -wxpython. If you want to build with wxpython support you'll need to build with [ram@skymoo ~]$ sudo port install py25-matplotlib -tkinter +wxpython
DEBUG: variants to install {} numpy wxpython DEBUG: available variants are : universal cairo gtk2 tkinter wxpython DEBUG: variant wxpython is present in py25-matplotlib 0.91.2_0 DEBUG: new portvariants: wxpython + tkinter + cairo + DEBUG: Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/release/ports/python/ py25-matplotlib DEBUG: Requested variant darwin is not provided by port py25-matplotlib. DEBUG: Requested variant i386 is not provided by port py25-matplotlib. DEBUG: Requested variant macosx is not provided by port py25-matplotlib. DEBUG: Executing variant cairo provides cairo DEBUG: Executing variant tkinter provides tkinter Error: Variant tkinter conflicts with wxpython DEBUG: Error evaluating variants while executing "error "Error evaluating variants"" (procedure "mportopen" line 51) invoked from within "mportopen $porturl [array get options] [array get variations]" Error: Unable to open port: Error evaluating variants
I notice you're trying to upgrade the port, AFAIK you cannot specify new variants on upgrading a port; if you want to modify the variants used you'll need to reinstall. I I don't get this error when trying to install the port using the above variants [ram@skymoo ~]$ sudo port install py25-matplotlib +cairo +tkinter -wxpython ---> Fetching py25-matplotlib ---> Verifying checksum(s) for py25-matplotlib ---> Extracting py25-matplotlib ---> Applying patches to py25-matplotlib ---> Configuring py25-matplotlib ---> Building py25-matplotlib with target build ---> Staging py25-matplotlib into destroot ---> Installing py25-matplotlib 0.91.2_0+cairo+tkinter ---> Activating py25-matplotlib 0.91.2_0+cairo+tkinter ---> Cleaning py25-matplotlib [ram@skymoo ~]$ python Python 2.5.1 (r251:54863, Dec 13 2007, 12:28:27) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information.
from pylab import * plot([1,2,3,4]) [<matplotlib.lines.Line2D instance at 0x2c23f58>] show()
the wxpython variant also works for me: ram@skymoo ~]$ sudo port install py25-matplotlib -tkinter +wxpython ---> Fetching py25-matplotlib ---> Verifying checksum(s) for py25-matplotlib ---> Extracting py25-matplotlib ---> Applying patches to py25-matplotlib ---> Configuring py25-matplotlib ---> Building py25-matplotlib with target build ---> Staging py25-matplotlib into destroot ---> Installing py25-matplotlib 0.91.2_0+wxpython ---> Activating py25-matplotlib 0.91.2_0+wxpython ---> Cleaning py25-matplotlib [ram@skymoo ~]$ python Python 2.5.1 (r251:54863, Dec 13 2007, 12:28:27) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information.
from pylab import * plot([1,2,3,4]) [<matplotlib.lines.Line2D instance at 0x2c23f58>] show()
And the gtk2 variant: [ram@skymoo ~]$ sudo port install py25-matplotlib -tkinter +gtk2 ---> Fetching py25-matplotlib ---> Verifying checksum(s) for py25-matplotlib ---> Extracting py25-matplotlib ---> Applying patches to py25-matplotlib ---> Configuring py25-matplotlib ---> Building py25-matplotlib with target build ---> Staging py25-matplotlib into destroot ---> Installing py25-matplotlib 0.91.2_0+gtk2 ---> Activating py25-matplotlib 0.91.2_0+gtk2 ---> Cleaning py25-matplotlib [ram@skymoo ~]$ python Python 2.5.1 (r251:54863, Dec 13 2007, 12:28:27) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information.
from pylab import * plot([1,2,3,4]) [<matplotlib.lines.Line2D instance at 0x2c23fa8>] show()
I'm not sure what to suggest as I cannot reproduce the errors you've encountered... Cheers Adam
Adam Mercer <ramercer <at> gmail.com> writes:
I notice you're trying to upgrade the port, AFAIK you cannot specify new variants on upgrading a port; if you want to modify the variants used you'll need to reinstall. I I don't get this error when trying to install the port using the above variants
True, thanks. I did a default install after cleaning (just +tkinter), which builds OK, but I'm still getting a segfault after X pops up a blank window. Recording the stack trace for posterity; I understand this is something you're not seeing. JDO Thread 0 Crashed: 0 com.tcltk.tcllibrary 0x01c53f40 TclpFree + 73 1 com.tcltk.tcllibrary 0x01c5007e ResetObjResult + 170 2 com.tcltk.tklibrary 0x01d088c6 Tk_MainWindow + 98 3 _tkagg.so 0x01bcb320 PyAggImagePhoto(void*, Tcl_Interp*, int, char**) + 32 4 com.tcltk.tcllibrary 0x01bfdaeb TclInvokeStringCommand + 117 5 libtcl8.5.dylib 0x0a010368 TclEvalObjvInternal + 1592 6 libtcl8.5.dylib 0x0a01074b Tcl_EvalObjv + 59 7 _tkinter.so 0x017da848 Tkapp_Call + 200 8 org.python.python 0x001ecf3b PyEval_EvalFrame + 22523 ...
On Jan 28, 2008 1:08 PM, John Owens <john_owens@yahoo.com> wrote:
True, thanks. I did a default install after cleaning (just +tkinter), which builds OK, but I'm still getting a segfault after X pops up a blank window. Recording the stack trace for posterity; I understand this is something you're not seeing.
Thats correct, I'm not seeing anything like this... don't know what else to suggest. Cheers Adam
John, If it makes you feel any better, I'm going through the same battle right now. Did you get anything working? I've been trying to use Tkinter, and I get segfaults on show(). Hunter -- View this message in context: http://www.nabble.com/matplotlib%3A-no-interactive-backends-appear-to-work-t... Sent from the MacPorts - Users mailing list archive at Nabble.com.
On Sat, Mar 1, 2008 at 11:41 AM, hjfreyer <hjfreyer@gmail.com> wrote:
If it makes you feel any better, I'm going through the same battle right now. Did you get anything working? I've been trying to use Tkinter, and I get segfaults on show().
Are you getting the segfault from the same functions? Cheers Adam
Aha! Nevermind. Still not working on Tkinter, but I installed the GTKAgg backend and that works perfectly. Still, it's curious that Tk shouldn't work. It works for regular python but matplotlib doesn't like it. Ah well, a mystery for another day. Thanks, Hunter -- View this message in context: http://www.nabble.com/matplotlib%3A-no-interactive-backends-appear-to-work-t... Sent from the MacPorts - Users mailing list archive at Nabble.com.
participants (6)
-
Adam Mercer
-
Adam Mercer
-
Guido Soranzio
-
hjfreyer
-
Jochen Küpper
-
John Owens