problems with nltk

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Katja Filippova

    problems with nltk

    hi,

    Has anybody tried using natural language toolkit
    (http://nltk.sourceforge.net/) under Python (my version is 2.1.1)?

    problems:
    first, I wanted to import a module, as it is written in the manual, but
    it didn't work:[color=blue][color=green][color=darkred]
    >>> from nltk.token import *[/color][/color][/color]
    Traceback (most recent calls last):
    File "<stdin>", line 1, in ?
    ImportError: No module named nltk.token

    since there was such module I thought that Python simply didn't look for
    it in the right directory and I rewrote the path:

    import sys, os
    SRCDIR="/home/name/nltk-1.3"
    sys.path.append (SRCDIR)
    print sys.path

    After that the error message changed to:
    [color=blue][color=green][color=darkred]
    >>> from nltk.token import *[/color][/color][/color]
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "__init__.p y", line 49, in ?
    ----------------
    File "/...........pyth on211/lib/python2.1/lib-tk/Tkinter.py", line
    35, in ?
    import _tkinter # If this fails your Python may not be configured for Tk
    ImportError: libtk8.3.so: cannot open shared object file: No such file
    or directory

    Then I typed import _tkinter but it didn't help, I got the same error
    message as before:

    File "/...........pyth on211/lib/python2.1/lib-tk/Tkinter.py", line
    35, in ?
    import _tkinter # If this fails your Python may not be configured for Tk
    ImportError: libtk8.3.so: cannot open shared object file: No such file
    or directory

    If I try to import the module again I get:

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "/home/name/nltk-1.3/nltk/token.py", line 308
    yield self._deep_rest rict(item, props, incl)
    ^
    SyntaxError: invalid syntax

    Does it really mean that Python is not configured for Tk? What does
    "<stdin>" mean? Is it the problem with nltk rather than with Python?

    thanx in advance,
    Katja


Working...