error problems for import some copora with nltk

Fredrik Lundh fredrik at
Wed Dec 22 08:15:25 CET 2004

<ekyungchung at> 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

if importing nltk works, check if there's a "\python24\nltk\corpus\"
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")


More information about the Python-list mailing list