安装教程:http://nltk.org/install.html

1、查看Python版本
打开python的IDLE就能看到python的版本

如上图,我的python的版本为2.7.3。另外,我们也可以在控制台输入 python -v 来查看python的版本。
2、下载安装文件:https://pypi.python.org/pypi/setuptools

文件默认下载到Downloads目录下。
在~目录下输入命令:sudo sh Downloads/setuptools-...egg
我的情况是输入:sudo sh Downloads/setuptools-0.6c11-py2.7.egg
3、安装
如果到现在为止都成功的话,接下来只需要输入三个命令,分别安装Pip、Numpy、PyYAML和NLTK
安装 Pip: sudo easy_install pip
安装 Numpy (可选): sudo pip install -U numpy
安装 PyYAML and NLTK: sudo pip install -U pyyaml nltk
4、测试
如果之前都已经安装成功,接下来进行简单的测试,如果简单的测试通过,我们就可以使用NLTK啦!
打开python的IDLE,输入 import nltk。
成功情况会是这样:

失败情况就会是这样:

如果你安装成功,那么祝贺你,你可以开始使用NLTK啦!