From: John H. <jdh...@ac...> - 2004-03-02 13:19:08
|
>>>>> "Dominique" == Dominique Orban <do...@da...> writes: Dominique> Just wanted to signal some path issues with the current Dominique> Windows installer. I have looked in the mailing list, Dominique> but haven't seen anyone having the same problem. Dominique> In both Windows 2000 and XP, installation of Matplotlib Dominique> 0.50 results in the following directory hierarchy in my Dominique> main Python directory c:\Python23\Lib\site-packages Dominique> (Enthought Edition): Dominique> 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 ] Dominique> it says it cannot import 'fontTools' (lowercase f, Dominique> uppercase T). Changing the name of the top directory Dominique> (FontTools) to 'fontTools' doesn't solve it of course, Dominique> since what it is looking for is the innermost Dominique> one. Hence i must move the 'fontTools' directory one Dominique> level up. Next, it can import ttLib, scans my TTFPATH, Dominique> but breaks down (after litterally one zillion messages) Dominique> saying that 'module' has no attribute 'SFNTReader'. It Dominique> is in fact trying to import sfnt and is stuck in the Dominique> __init__() of Class TTFont. Drastically reducing my Dominique> TTFPATH, i see that the error is in fact coming from Dominique> the fact that it cannot import module 'sstruct' in Dominique> 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. Dominique> That stuns me. A 'from fontTools import sstruct' would Dominique> do. How comes Python isn't looking recursively into Dominique> directories? I guess moving everything to the top level Dominique> isn't a good idea. Also, still in sfnt.py, the 'import Dominique> struct' works, but i have no clue where it finds this Dominique> one; a search was unsuccessful. Anyhow, including Dominique> 'c:\Python23\fontTools' into the PYTHONPATH solves it Dominique> but i thought directories would be parsed recursively. Dominique> Also, can you only use savefig() with the Agg backend? Dominique> 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. Dominique> As they told me to at SuSE, i'm having a lot of fun. You mean battling the hairy windows beast? JDH |