Using NLTK with mod_python

Chris Barlow <[email protected]> Sat, 23 Jan 2010 23:37:25 -0500
Newsgroups gmane.comp.python.mod_python
Message-ID <[email protected]>
Hi,

I'm a complete noob, so please be patient. I've installed mod_python
and all seems good, but importing nltk generates errors.

I'm operating on XP with Apache 2.0. I've tried mod_python with Python
version 2.4 and 2.5, but I get errors. With 2.5 the error is:

.....

File "C:\Python25\Lib\site-packages\nltk\data.py", line 80, in <module>
os.path.join(os.environ['APPDATA'], 'nltk_data')]

File "C:\Python25\lib\os.py", line 433, in __getitem__
return self.data[key.upper()]

KeyError: 'APPDATA'

My code is:

from mod_python import apache
import sys
import nltk

def handler(req):
req.content_type = 'text/plain'
s= sys.version
req.write(s)

return apache.OK

I'm sure I'm doing something dumb, but with one day's experience of
Python - told you I was a noob - I haven't the foggiest. I've googled
obvious terms, but with no luck.

Any ideas?

Thanks,

Chris

_______________________________________________
Mod_python mailing list
[email protected]
http://mailman.modpython.org/mailman/listinfo/mod_python