error problems for import some copora with nltk

E

ekyungchung

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

===================================================
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
 
F

Fredrik Lundh

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

===================================================

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top