1: check the link http://www./install.html, and download the nltk3 file. 2: besides python3, we also need to install the following.
sudo apt-get install python3-pip python3-dev
$ sudo pip3 install pyyaml
$ wget http://www.nltk.org/nltk3-alpha/nltk-3.0a3.tar.gz
$ tar -xzvf nltk-3.0a3.tar.gz
$ cd nltk-3.0a3/
$ sudo python3 setup.py install ( 上面这3步,就是install 文件里有)
$ python3
>>> import nltk
>>> from nltk.corpus import brown
>>> print(brown.sents()[0])
and the nltk data from the page http://www./data.html
Command line installation
To ensure central installation, run the command
$ sudo python3 -m nltk.downloader -d /usr/share/nltk_data all
|