WinXP vs. Win98

Discussion in 'Python' started by sidanko@scientist.com, Oct 26, 2005.

  1. Guest

    I use Python 2.3.3 (Enthought edition) with wxPython and it is
    installed on both WinXP and Win98. On Win98 machine I have the
    following error:
    ------------------------------------------------------------------------
    Traceback (most recent call last):
    File
    "C:\PYTHON23\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
    line 310, in RunScript
    exec codeObject in __main__.__dict__
    File "C:\My Documents\Programs\Python\SDV.py", line 2, in ?
    from chaco.wxplot import *
    File "C:\PYTHON23\lib\site-packages\chaco\wxplot.py", line 17, in ?
    from wxplot_window import PlotWindow, PlotTraitSheet
    File "C:\PYTHON23\lib\site-packages\chaco\wxplot_window.py", line 5,
    in ?
    from wxplot_window_agg import *
    File "C:\PYTHON23\lib\site-packages\chaco\wxplot_window_agg.py", line
    27, in
    from kiva.agg import CAP_BUTT
    File "C:\PYTHON23\lib\site-packages\kiva\agg\__init__.py", line 1, in
    ?
    from agg import *
    File "C:\PYTHON23\lib\site-packages\kiva\agg\agg.py", line 734, in ?
    import freetype
    File "C:\PYTHON23\lib\site-packages\freetype\__init__.py", line 6, in
    ?
    from freetype import FreeType
    File "C:\PYTHON23\lib\site-packages\freetype\freetype.py", line 10,
    in ?
    from font_lookup import default_font_info
    File "C:\PYTHON23\lib\site-packages\freetype\font_lookup.py", line
    24, in ?
    font_dirs.append(os.path.join(os.environ[ 'systemroot' ],'fonts'))
    File "C:\PYTHON23\lib\os.py", line 417, in __getitem__
    return self.data[key.upper()]
    KeyError: 'SYSTEMROOT'
    >>>

    -----------------------------------------------------------------------
    Hovewer running very the same script on WinXP machine I have no
    problems at all. What's wrong? Kiva package (as well as others) is
    installed properly. Where to dig?

    AS
    , Oct 26, 2005
    #1
    1. Advertising

  2. wrote:

    > I use Python 2.3.3 (Enthought edition) with wxPython and it is
    > installed on both WinXP and Win98. On Win98 machine I have the
    > following error:


    > File "C:\PYTHON23\lib\site-packages\freetype\font_lookup.py", line
    > 24, in ?
    > font_dirs.append(os.path.join(os.environ[ 'systemroot' ],'fonts'))
    > File "C:\PYTHON23\lib\os.py", line 417, in __getitem__
    > return self.data[key.upper()]
    > KeyError: 'SYSTEMROOT'
    > >>>


    > Hovewer running very the same script on WinXP machine I have no
    > problems at all. What's wrong? Kiva package (as well as others) is
    > installed properly. Where to dig?


    Windows XP has SystemDrive and SystemRoot environment variables,
    while Windows 98 don't seem to have them.

    a quick workaround is to set the SystemRoot environment by hand (it should
    point to the Windows system directory; usually c:\windows. iirc, you have to
    edit AUTOEXEC.BAT or run the MSCONFIG utility to set them).

    alternatively, you can add the following fix to your application code:

    import os
    os.environ["SystemRoot"] = os.environ.get("windir", "c:\\windows")

    (put it *before* the wxplot import code)

    a better fix is to make the freetype font_lookup code a bit more robust.

    </F>
    Fredrik Lundh, Oct 26, 2005
    #2
    1. Advertising

  3. sidanko Guest

    Thanks a lot! I have set the environment variable and now it runs just
    fine!
    sidanko, Oct 26, 2005
    #3
  4. sidanko Guest

    Thanks a lot! I have set the environment variable and now it runs just
    fine!

    AS
    sidanko, Oct 26, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gordon

    Unicode Support In chinese Win98

    Gordon, Oct 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    346
    Gordon
    Oct 22, 2003
  2. Vanga Sasidhar
    Replies:
    1
    Views:
    436
    Bruno Sirianni
    Apr 3, 2004
  3. Reuben L.
    Replies:
    9
    Views:
    473
    William Tasso
    Nov 1, 2003
  4. Robert
    Replies:
    1
    Views:
    279
    Michel Claveau/Hamster
    Jan 19, 2004
  5. Tim Golden
    Replies:
    2
    Views:
    349
    Robert
    Jan 21, 2004
Loading...

Share This Page