I am trying to use a python module (nltk) in web2py.
I am able to use the module from the python command line without issues. In Web2py I get the error below.
Thanks!
Simple example Code:
import nltk
from nltk.corpus import wordnet as wn
def get_thes():
wn.synset('car.n.01').lemma_names
return dict()
Error
web2py™ Version 2.5.1-stable+timestamp.2013.06.06.15.39.19
Python Python 2.7.3: /usr/bin/python (prefix: /usr)
Traceback (most recent call last):
File "/home/www-data/web2py/gluon/restricted.py", line 212, in restricted
exec ccode in environment
File "/home/www-data/web2py/applications/Wordgf/controllers/thes.py", line 1, in <module>
import nltk
File "/home/www-data/web2py/gluon/custom_import.py", line 95, in custom_importer
raise e2 # there is an error in the module
AttributeError: 'module' object has no attribute 'error'