error problems for import some copora with nltk
Fredrik Lundh
fredrik at pythonware.com
Wed Dec 22 02:15:25 EST 2004
<ekyungchung at gmail.com> wrote:
>I did install the python 2.4 and nltk.
> I am trying to follow the tutorial, but I kept getting error messages
> about importing corpus as follows
>
> ===================================================
>>>> from nltk.corpus import gutenberg
>
> Traceback (most recent call last):
> File "<pyshell#3>", line 1, in -toplevel-
> from nltk.corpus import gutenberg
> ImportError: cannot import name gutenberg
> ===================================================
>
> I got the data files under c:\\python24\nltk\
> Do you know why I can't get the result?
> Any help?
what happens if you import "nltk" ? if you still get an exception, you haven't
installed nltk in a proper way; double-checking the installation instructions might
help.
if importing nltk works, check if there's a "\python24\nltk\corpus\gutenberg.py"
or similar file.
if both the above are try, try doing this before importing the gutenberg module:
import sys
sys.path.insert(0, "c:/python24")
</F>
More information about the Python-list
mailing list