Question

I want to install nltk 3.0 on Ubuntu 13.10.

I have been running Ubuntu for a few weeks (first time I am using Linux) and I have just downloaded python 3.4.0 - 3.3 is also on Ubuntu since it was installed with the operating system. Python 2.5+ is also preinstalled and I actually have the nltk (not 3.0) installed using the terminal and can use this in my python 2 idle, but not my python 3 idle as expected.

However, and my newbieness will shine here. I have no idea where 3.4 installed, so I don't know where to unzip the nltk-3.0a3.tar.gz !!

I am fine with using the terminal to download if needed, I just don't know how with nltk 3.4 either.

Was it helpful?

Solution

see How to use nltk3 for python33?

First install python3-pip then use it to install pyyaml

$ sudo apt-get install python3-pip
$ 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
$ python3
>>> import nltk
>>> from nltk.corpus import brown
>>> print(brown.sents()[0])
['The', 'Fulton', 'County', 'Grand', 'Jury', 'said', 'Friday', 'an', 'investigation', 'of', "Atlanta's", 'recent', 'primary', 'election', 'produced', '``', 'no', 'evidence', "''", 'that', 'any', 'irregularities', 'took', 'place', '.']
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top