[Pythonmac-SIG] Import problem (MacPython-2.3b2 OSX)
Brian Lenihan
brian_l at mac.com
Wed Jun 11 17:59:46 EDT 2003
On Wednesday, June 11, 2003, at 04:39 PM, Kaweh Kazemi wrote:
> Hi all,
>
> Installed MacPython-2.3b2 (OS X 10.2.6) and have following problem:
> running the attached test.py program in a shell produces attached
> output (test_shell_output.txt).
>
> When I start the same script as a CGI script, I get a different output
> (test_cgi_output.txt) - the only difference is that the CGI script is
> not able to import elementtree (which I installed manually using "sudo
> python setup.py install").
>
> Also the CGI script can not import site, giving following traceback
> during site import (used -v):
>
> 'import site' failed; traceback:
> Traceback (most recent call last):
> File
> "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/
> site.py", line 180, in ?
> home = os.environ['HOME']
> File
> "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/
> UserDict.py", line 19, in __getitem__
> def __getitem__(self, key): return self.data[key]
> KeyError: 'HOME'
>
change line 180 in site.py to:
home = os.environ.get('HOME')
It's been fixed since the 2.3b2 release
More information about the Pythonmac-SIG
mailing list