Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > WinXP vs. Win98

Reply
Thread Tools

WinXP vs. Win98

 
 
sidanko@scientist.com
Guest
Posts: n/a
 
      10-26-2005
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

 
Reply With Quote
 
 
 
 
Fredrik Lundh
Guest
Posts: n/a
 
      10-26-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) 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>



 
Reply With Quote
 
 
 
 
sidanko
Guest
Posts: n/a
 
      10-26-2005
Thanks a lot! I have set the environment variable and now it runs just
fine!

 
Reply With Quote
 
sidanko
Guest
Posts: n/a
 
      10-26-2005
Thanks a lot! I have set the environment variable and now it runs just
fine!

AS

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Win98 vs Win98 SE - Bobb - Computer Information 12 12-14-2006 10:46 PM
Re: Win98 vs Win98 SE - Bobb - Computer Information 2 12-06-2006 06:52 PM
ics win98/winxp Michael Bauer Wireless Networking 1 06-06-2005 05:28 PM
win98/xp dual boot- how to remove win98 Roger Marriott NZ Computing 1 11-17-2003 08:53 PM
basic html page: shows up in Win98, NOT in WinXP (usually)...!!!? Reuben L. HTML 9 11-01-2003 02:15 AM



Advertisments