can't import pylab

As this problem looks font related I should mention that

    > there are two versions of freetype2 on my system (Suse
    > 9.0). one in /usr/lib that came with my system, and one in
    > /usr/local that I installed myself. I unistalled the
    > headerfiles and static libs of the one which came with the
    > system. The run time linker is finding the new one, so
    > matplot is compiling and linking against the same version.

Hey Joe, thanks for the detailed info. These kinds of bugs are very
hard to track down since I can't replicate them. A few suggestions.
rm -rf your "build" sub-directory *and* site-packages/matplotlib and
get a clean install to make sure there is no lingering old code
linking to the old freetype. Make sure you have a pretty recent
freetype (eg >= 2.1.7). What version *are* you using?

Once you get matplotlib reinstalled, see if you can replicate the bug.
If not, good. If so, send an ldd of
site-packages/matplotlib/ft2font.so, and see if you can reproduce the
problem with a minimal script, eg

  from matplotlib.ft2font import FT2Font
  font = FT2Font('/your/path/to/Vera.ttf')
  font.set_size(40, 150)
  font.set_text('finish it', 40)
  font.draw_glyphs_to_bitmap()
  fname = 'font.raw'
  font.write_bitmap(fname)

This will take out a lot of the unknowns. The FT2Font constructor
does call the FT_Get_Postscript_Name function, which appears to be
involved according to your gdb session.

Thanks,
JDH

Hi, thanks for the quick responce. Turns out that this is a bug in gcc. By
default freetype builds with the -O2 option, needs to be -O0. Apparently this
is fixed in newer versions of gcc, I'm using "3.3.1 (SuSE Linux)".

It looks like other programs such as KDE and Mozilla don't tread on this bug.
Well, if its true that ldd doesn't lie.

Cheers

Joe

···

On Sunday 13 February 2005 8:21 pm, John Hunter wrote:

Hey Joe, thanks for the detailed info. These kinds of bugs are very
hard to track down since I can't replicate them. A few suggestions.
rm -rf your "build" sub-directory *and* site-packages/matplotlib and
get a clean install to make sure there is no lingering old code
linking to the old freetype. Make sure you have a pretty recent
freetype (eg >= 2.1.7). What version *are* you using?