crash on MacOS X

Russell E Owen wrote:

Interesting idea. I'm not sure I'd know how to use more than one numerix option at once,

well, I dint' mean more than one numerix option, exactly. What I meant was that MPL is using numarray, but another module you've imported is using Numeric (or numpy or whatever).

> but it did inspire me to try a few things:

backend : TkAgg
numerix : numarray
interactive : True
and the crash still happens:
from pylab import *
plot([1,2,3,4])

I also tried setting numerix to Numeric and it still happens.

Does it happen with wxAgg? or just plain ol Agg? also try the non-agg TK back-end.

If not, then you've apparently found a tkAgg bug.

TK has always been a bit of a second-class citizen on the Mac -- why haven't you switched to wx yet? :wink:

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Russell E Owen wrote:

Interesting idea. I'm not sure I'd know how to use more than one numerix option at once,

well, I dint' mean more than one numerix option, exactly. What I meant was that MPL is using numarray, but another module you've imported is using Numeric (or numpy or whatever).

Ah. I can guarantee that's happening. Some of my code uses Numeric (due to high speed on short arrays) and some uses numarray (because I started using it for all new code when it looked like it would take over). I hope to switch to numpy for everything once the dust settles, but I don't want to force my users to all move at once (a lot of them are on unix and will have to manually install numpy -- no big deal, but I get complaints every time I require a new package).

> but it did inspire me to try a few things:

backend : TkAgg
numerix : numarray
interactive : True
and the crash still happens:
from pylab import *
plot([1,2,3,4])

I also tried setting numerix to Numeric and it still happens.

Does it happen with wxAgg? or just plain ol Agg? also try the non-agg TK back-end.

I don't have wx or gtk installed, so no easy way to test those backends.

It does not crash with plain old Agg (but of course I don't see any plot).

I'll be happy to try the "non-agg TK back-end" if you can tell me what setting to use for it. I didn't see it in the matplotlibrc's list of options (but WXAgg is also missing from that particular list), nor on the "Which backend should I use?" page.

If not, then you've apparently found a tkAgg bug.

TK has always been a bit of a second-class citizen on the Mac -- why haven't you switched to wx yet? :wink:

I started this project several years ago and at the time Tcl/Tk was the only game in town for Mac+unix+windows cross-platform support. Admittedly the Mac support was poor, but it has gotten much better, and I like Tkinter pretty well overall. It would be a major job to switch now and I doubt I can justify the expense and time. Sometimes I wish I'd used Java, even though the I strongly prefer Python, just to get a standard GUI.

I'll try bulding matplotlib from source, just to see if there might be some quirk about the installer package.

-- Russell

···

At 3:12 PM -0700 9/15/06, Christopher Barker wrote:

Russell E Owen wrote:

well, I didnt' mean more than one numerix option, exactly. What I meant was that MPL is using numarray, but another module you've imported is using Numeric (or numpy or whatever).

Ah. I can guarantee that's happening. Some of my code uses Numeric (due to high speed on short arrays) and some uses numarray (because I started using it for all new code when it looked like it would take over).

Then this could be it. In general, they should co-exist just fine, but do know someone else has weird crashing problems when they were mixed with MPL (and GDAL, in his case). Both numpy and Numeric, and numarray have a lot of extension code that shares names, etc. who knows what problem that can cause?

> I

hope to switch to numpy for everything once the dust settles,

good plan, and it's getting close. The API should be stable now. The sooner the better, I think. You'll be a lot more help with bugs or potential bugs like this one.

I also tried setting numerix to Numeric and it still happens.

Darn.

I don't have wx or gtk installed, so no easy way to test those backends.

if you install the mpkg on pythonmac.org/packages, wx should work. that's pretty easy.

It does not crash with plain old Agg (but of course I don't see any plot).

Does it save a png successfully?

I'll be happy to try the "non-agg TK back-end" if you can tell me what setting to use for it.

hmm. I just assumed it was there, but I can't find it either.

I started this project several years ago and at the time Tcl/Tk was the only game in town for Mac+unix+windows cross-platform support.

I meant that tongue-in-cheek -- we all have our reasons, and I know you've been using TK for a good long time now.

Sometimes I wish I'd used Java, even though the I strongly prefer Python, just to get a standard GUI.

which one would that be? AWT? Swing? SWT?, or for that matter, wxJAVA.

I'll try bulding matplotlib from source, just to see if there might be some quirk about the installer package.

It's always worth a shot!

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

In article <450ED0D1.4020304@...259...>,

Russell E Owen wrote:
>> well, I didnt' mean more than one numerix option, exactly. What I meant
>> was that MPL is using numarray, but another module you've imported is
>> using Numeric (or numpy or whatever).
>
> Ah. I can guarantee that's happening. Some of my code uses Numeric (due
> to high speed on short arrays) and some uses numarray (because I started
> using it for all new code when it looked like it would take over).

Then this could be it. In general, they should co-exist just fine, but
do know someone else has weird crashing problems when they were mixed
with MPL (and GDAL, in his case). Both numpy and Numeric, and numarray
have a lot of extension code that shares names, etc. who knows what
problem that can cause?

> I
> hope to switch to numpy for everything once the dust settles,

good plan, and it's getting close. The API should be stable now. The
sooner the better, I think. You'll be a lot more help with bugs or
potential bugs like this one.

I look forward to the unification, but unfortunately I don't think it
will help with this crash (unless the very fact that the numarray and/or
Numeric are installed but not loaded can cause problems).

I see the crash even with this trivial script:

$ python

from pylab import *
plot([1,2,3,4])
show()

boom!

matplotlib 0.87.5 crashes with ~/.matplotlib/matplotlibrc set to use
numarray (1.5.1), Numeric or numpy (1.0b5).

> I don't have wx or gtk installed, so no easy way to test those backends.

if you install the mpkg on pythonmac.org/packages, wx should work.
that's pretty easy.

Fair enough. I installed wxPython (2.6) and the above scripts works fine
(as long as interactive is false).

> It does not crash with plain old Agg (but of course I don't see any plot).

Does it save a png successfully?

I can try this if you think it will help. It appears to be a lot more
work than just slapping up a plot using pylab so I've not tried it yet.

I also failed to build matplotlib from source. I had all the
prerequisites in /usr/local (and I reinstalled freetype 2.2.1 to be
sure, since the version shown in /usr/local/lib has no resemblance to
the source version). During the build I see these warnings (but no
errors):

/usr/bin/ld: for architecture i386
/usr/bin/ld: warning /usr/local/lib/libpng.dylib cputype (18,
architecture ppc) does not match cputype (7) for specified -arch flag:
i386 (file not loaded)

and after installation, importation of pylab fails as follows:

from pylab import *

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac
kages/pylab.py", line 1, in ?
    from matplotlib.pylab import *
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac
kages/matplotlib/pylab.py", line 200, in ?
    from axes import Axes, PolarAxes
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac
kages/matplotlib/axes.py", line 15, in ?
    from axis import XAxis, YAxis
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac
kages/matplotlib/axis.py", line 25, in ?
    from font_manager import FontProperties
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac
kages/matplotlib/font_manager.py", line 39, in ?
    from matplotlib import ft2font
ImportError: Failure linking new module:
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pack
ages/matplotlib/ft2font.so: Symbol not found:
_FMDisposeFontFamilyIterator
  Referenced from: /usr/local/lib/libfreetype.6.dylib
  Expected in: flat namespace

-- Russell

···

Christopher Barker <Chris.Barker@...259...> wrote: