Just wanted to signal some path issues with the current
> Windows installer. I have looked in the mailing list,
> but haven't seen anyone having the same problem.
> In both Windows 2000 and XP, installation of Matplotlib
> 0.50 results in the following directory hierarchy in my
> main Python directory c:\Python23\Lib\site-packages
> (Enthought Edition):
> FontTools/ fontTools/ sstruct.py ttLib/
Critically, you should also have
c:\Python23\Lib\site-packages\FontTools.pth. I am pretty certain it
is in the windows installer. This file should contain one line, which
reads simply
FontTools
If you don't have it I would like to know!
ttfquery and FontTools are packages to enable cross platform
font-finding. I am very interested in factoring out this dependency
since it complicates installation (as you are seeing). [ Perry, if
anyone in your group is still interested in this, there is a
reasonably well documented example in cvs examples/ftface_props.py
that shows how to access all the relevant freetype attributes (family
name, is italics, etc) using the matplotlib.ft2face module ]
> it says it cannot import 'fontTools' (lowercase f,
> uppercase T). Changing the name of the top directory
> (FontTools) to 'fontTools' doesn't solve it of course,
> since what it is looking for is the innermost
> one. Hence i must move the 'fontTools' directory one
> level up. Next, it can import ttLib, scans my TTFPATH,
> but breaks down (after litterally one zillion messages)
> saying that 'module' has no attribute 'SFNTReader'. It
> is in fact trying to import sfnt and is stuck in the
> __init__() of Class TTFont. Drastically reducing my
> TTFPATH, i see that the error is in fact coming from
> the fact that it cannot import module 'sstruct' in
> sfnt.py.
All of this is consistent with a missing FontTools.pth. ttfquery will
try and load each windows font, but catches all exceptions and
continues. So you'll get an exception *for each font* the first time
you load ttfquery if something is wrong with your install. After you
have fixed fontools, be sure to remove site-packages/font.cache so
ttfquery can regenerate the font cache.
> That stuns me. A 'from fontTools import sstruct' would
> do. How comes Python isn't looking recursively into
> directories? I guess moving everything to the top level
> isn't a good idea. Also, still in sfnt.py, the 'import
> struct' works, but i have no clue where it finds this
> one; a search was unsuccessful. Anyhow, including
> 'c:\Python23\fontTools' into the PYTHONPATH solves it
> but i thought directories would be parsed recursively.
> Also, can you only use savefig() with the Agg backend?
> show() isn't popping any window.
Agg is a pure image backend - ie, it only produces image output. In
the next release of matplotlib (this week) there will are 2 GUI
backends that use agg for rendering GtkAgg and TkAgg, both of which
are compiled into the windows installer.
> As they told me to at SuSE, i'm having a lot of fun.
You mean battling the hairy windows beast?
JDH