4

I have the python (2.7.5) and python-nltk packages installed in Ubuntu 13.10. Running apt-cache policy python-nltk returns:

python-nltk:
  Installed: 2.0~b9-0ubuntu4

And according to the Stanford site, 2.0+ should have the stanford module. Yet when I try to import it, I get an error:

>>> import nltk.tag.stanford
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named stanford

How can I get the stanford module? (Preferably through the usual repositories, since I don't like to install software outside the Ubuntu package manager.)

Jonathan
  • 10,571
  • 13
  • 67
  • 103
  • 1
    hi! have you looked at this other related question? http://stackoverflow.com/q/8555312/583834. also, i just created a virtualenv on a mac, did `pip install nltk` and `import nltk.tag.stanford` worked without doing `nltk.download()`. having said that, i have no idea where the needed files (namely `/usr/share/stanford-ner/classifiers/all.3class.distsim.crf.ser.gz` and `/usr/share/stanford-ner/stanford-ner.jar`) are... – arturomp Nov 01 '13 at 03:23

1 Answers1

8

You need to use NLTK downloader:

import nltk
nltk.download()
Luis Miguel
  • 5,057
  • 8
  • 42
  • 75