error problems for import some copora with nltk

Discussion in 'Python' started by ekyungchung@gmail.com, Dec 22, 2004.

  1. Guest

    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?

    Thanks in advance,

    Kyung in Texas
    , Dec 22, 2004
    #1
    1. Advertising

  2. <> 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>
    Fredrik Lundh, Dec 22, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. j_pennington_moore

    newbie NLTK question

    j_pennington_moore, Jul 20, 2004, in forum: Python
    Replies:
    0
    Views:
    321
    j_pennington_moore
    Jul 20, 2004
  2. Tony Meyer
    Replies:
    6
    Views:
    1,387
  3. Passer By

    NLTK, Random Sentence Generators?

    Passer By, Apr 10, 2007, in forum: Python
    Replies:
    8
    Views:
    1,945
    Oleg Alexander
    Apr 12, 2007
  4. Steven Bird
    Replies:
    1
    Views:
    392
    tool69
    May 26, 2007
  5. Error in Python NLTK

    , Apr 6, 2013, in forum: Python
    Replies:
    8
    Views:
    182
    Steven D'Aprano
    Apr 7, 2013
Loading...

Share This Page