[!SPAM?:XXXII] Re: matplotlib: no interactive backends appear to work

Adam Mercer ramercer at gmail.com
Mon Jan 28 08:50:53 PST 2008


On Jan 28, 2008 11:19 AM, John Owens <john_owens at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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


More information about the macports-users mailing list