From: Dominique O. <do...@da...> - 2004-03-02 06:30:33
|
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/ When i try to import the Agg backend: import matplotlib matplotlib.use( 'Agg' ) from matplotlib.matlab import * 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. 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. As they told me to at SuSE, i'm having a lot of fun. Dominique |
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 |
From: Paul B. <ba...@st...> - 2004-03-02 15:18:59
|
John Hunter wrote: > > 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 ] Hi John, I'm currently working on a replacment for FontTools. I hope to have something out in the next day or so. -- Paul -- Paul Barrett, PhD Space Telescope Science Institute Phone: 410-338-4475 ESS/Science Software Branch FAX: 410-338-4767 Baltimore, MD 21218 |
From: Dominique O. <do...@da...> - 2004-03-02 14:00:05
|
* On Tue, 02 Mar 2004, John Hunter wrote: > 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! I don't have it actually. It is on neither of my Windows installs. Can i just create it? I haven't seen any other user complain about this. Could this come from an upgrade of matplotlib? During the upgrade, it seems to be backing up stuff but who knows what it is doing exactly. > 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. The font.cache is in site-packages/ttfquery, i presume this is correct? > 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. Great! Thanks much, Dominique |
From: John H. <jdh...@ac...> - 2004-03-02 14:56:24
|
>>>>> "Dominique" == Dominique Orban <do...@da...> writes: Dominique> I don't have it actually. It is on neither of my Dominique> Windows installs. Can i just create it? OK, this is a bug in the windows installer - fixed for next release. Yes, just create it. Dominique> I haven't seen any other user complain about Dominique> this. Could this come from an upgrade of matplotlib? Dominique> During the upgrade, it seems to be backing up stuff but Dominique> who knows what it is doing exactly. Well, you would only notice it if 1) you haven't installed FontTools before 2) you are using windows 3) you are trying to use on of the FontTools dependent backends (Agg, GD) and 4) you are kind enough to report the problem. Dominique> The font.cache is in site-packages/ttfquery, i presume Dominique> this is correct? After you fix the FontTools.pth problem erase this file and it will be automagically recreated by ttfquery. JDH |
From: Dominique O. <do...@da...> - 2004-03-02 15:10:30
|
* On Tue, 02 Mar 2004, John Hunter wrote: > > >>>>> "Dominique" == Dominique Orban <do...@da...> writes: > > Dominique> I don't have it actually. It is on neither of my > Dominique> Windows installs. Can i just create it? > > OK, this is a bug in the windows installer - fixed for next release. > Yes, just create it. Allright thanks. In Linux, i can compile the new matplotlib with gcc 3.3. I notice the same problem with fontTools. This time i do have a FontTools.pth in my source directory, but it isn't copied to /whatever/python2.3/site-packages when i run python setup.py install. Now it doesn't find _backend_agg. Sorry to be bugging you with all these minor annoyances. Also i notice the 'afm' problem i reported earlier with the PS backend hasn't been fixed. Did you receive my little fix? Dominique |
From: John H. <jdh...@ac...> - 2004-03-02 15:57:59
|
>>>>> "Dominique" == Dominique Orban <do...@da...> writes: Dominique> Allright thanks. In Linux, i can compile the new Dominique> matplotlib with gcc 3.3. I notice the same problem Dominique> with fontTools. This time i do have a FontTools.pth in Dominique> my source directory, but it isn't copied to Dominique> /whatever/python2.3/site-packages when i run python Dominique> setup.py install. Just copy the file to site-packages. This problem is fixed in CVS but with Paul's new font finder hopefully it will soon be a non-issue. Dominique> Now it doesn't find _backend_agg. Sorry to be bugging Dominique> you with all these minor annoyances. No problem - I want to fix these problems as soon as possible so keep them coming. Did you edit setup.py? You need to set the flags BUILD_AGG and BUILD_FONTTOOLS. If this doesn't do it for you, please post compile errors or tracebacks. Dominique> Also i notice the 'afm' problem i reported earlier with Dominique> the PS backend hasn't been fixed. Did you receive my Dominique> little fix? Thanks for the reminder - it had slipped too low in the pile and I forgot about it. It's in now. JDH |