Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > error problems for import some copora with nltk

Reply
Thread Tools

error problems for import some copora with nltk

 
 
ekyungchung@gmail.com
Guest
Posts: n/a
 
      12-22-2004
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

 
Reply With Quote
 
 
 
 
Fredrik Lundh
Guest
Posts: n/a
 
      12-22-2004
<(E-Mail Removed)> 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>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using NLTK in Java hussainsaiger@gmail.com Python 5 09-02-2008 03:22 PM
NLTK: Natural language processing in Python Steven Bird Python 1 05-26-2007 05:40 AM
NLTK, Random Sentence Generators? Passer By Python 8 04-12-2007 04:57 PM
RE: error problems for import some copora with nltk Tony Meyer Python 6 12-23-2004 07:21 PM
newbie NLTK question j_pennington_moore Python 0 07-20-2004 03:53 AM



Advertisments