Well, I didn't know I needed to restart Apache.
Now I get a different error. I did the nltk download in python, but do I
need to do something in web2py?
Resource 'corpora/wordnet' not found. Please use the NLTK
Downloader to obtain the resource: >>> nltk.download().
Searched in:
- '/var/www/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'
On Sunday, June 16, 2013 8:47:10 PM UTC-4, Joe Magaro wrote:
>
>
> Hi, I have a thesaurus(nltk-wordnet) working from the python command line.
> However when I try to use it in Web2Py I get an error.
>
> Can someone help, please --- all the details are Below:
>
> 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.19PythonPython
> 2.7.3: /usr/bin/python (prefix: /usr)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
>
> 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"
> <https://www.mywebsonic.com/admin/default/edit/WordGurgle/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'
>
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.