How can I use nltk library in cloud9?



Hi there.

I want to use nltk in cloud9.
I tried to install nltk with pip but it says permission denied.
Is there way to use nltk in cloud 9?
thank you!


Could you please post the commands you have tried so far? Most likely, the problem is that you need to install as root, so try running the command with sudo (i.e. sudo pip3 install nltk or sudo pip install nltk). If it still errors, please post those errors here and we can try to further diagnose the problem.


pip install --user nltk into a virtualenv


I also facing the same problem. I did try running the command with sudo but still there is a syntax error on ‘pip’ as shown below. Can someone help me.

sudo pip install nltk
SyntaxError: invalid syntax


Create a virtualenv if you haven’t

$ virtualenv .

Start the env

$ source ./bin/activate

Your console will now look like

(workspace)kalinchernev:~/workspace $

workspace is the name of the virtualenv.

Then, install the dependency:

(workspace)kalinchernev:~/workspace $ pip install nltk

In an example file, put some hello world script

import nltk'punkt')

sentence = "At eight o'clock on Thursday morning Arthur didn't feel very good."

tokens = nltk.word_tokenize(sentence);


From the terminal, run the script

$ python

Output will be similar:

(workspace)kalinchernev:~/workspace $ python 
[nltk_data] Downloading package punkt to /home/ubuntu/nltk_data...
[nltk_data]   Package punkt is already up-to-date!
['At', 'eight', "o'clock", 'on', 'Thursday', 'morning', 'Arthur', 'did', "n't", 'feel', 'very', 'good', '.']

In short, nothing special regarding installation when you have an environment.