By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,403 Members | 1,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,403 IT Pros & Developers. It's quick & easy.

WinXP vs. Win98

P: n/a
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 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
si*****@scientist.com 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>

Oct 26 '05 #2

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

Oct 26 '05 #3

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

AS

Oct 26 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.