Under "Applications", select the subfolder "Utilities", and in there the application "Terminal". This gives you a small window where you can type in the NLTK installation commands.
Do not try to type the NLTK installation commands into a Python or Idle shell. It's a language problem: Idle speaks only Python. The installation commands are shellscript commands. So Idle does not understand them.
On Mac, use the Terminal
General Python pages:
The Natural Language Toolkit:
General installation tipsIf you typed "sudo pip install -U nltk" but got an error message that pip could not be found, try this instead:
sudo python3 -m pip install -U nltk
Error message on a Mac: compiler not found
After getting this error message, on student used the following steps to get NLTK working on her Mac:
sudo easy_install pip
sudo pip install numpy
sudo pip install nltk
Error on Windows: could not install nltk because of 64-bit Python
NLTK can only work with 32-bit Python
One student who encountered this problem said:
I managed to fix my problem installing NLTK by reinstalling Python with the 32-bit installer
(admittedly, the nltk page says to avoid 64-bit, but it doesn't emphasize it).
I also had to set a PYTHONPATH environment variable (to C:\Python27 in my case),
but I think that might just be because the old installation was causing conflicts.