Installing NLTK¶
NLTK requires Python versions 2.6-2.7. (A version supporting Python 3 is under development, see http://nltk.org/nltk3-alpha/).
Mac/Unix¶
- Open Finder>Applications>Utilities>Terminal and type python -V to find out what version of Python is installed
- Install Setuptools: Download the corresponding version of Setuptools from http://pypi.python.org/pypi/setuptools (scroll to the bottom, and pick the filename that contains the right version number and which has the extension .egg). Install it by typing sudo sh Downloads/setuptools-...egg, giving the location of the downloaded file.
- Install Pip: run sudo easy_install pip
- Install Numpy (optional): run sudo pip install -U numpy
- Install PyYAML and NLTK: run sudo pip install -U pyyaml nltk
- Test installation: run python then type import nltk
Windows¶
These instructions assume that you do not already have Python installed on your machine. If you do, you can skip to the final step and just install NLTK.
32-bit binary installation¶
- Install Python: http://www.python.org/download/releases/2.7.3/
- Install Numpy (optional): http://sourceforge.net/projects/numpy/files/NumPy/1.6.2/numpy-1.6.2-win32-superpack-python2.7.exe
- Install NLTK: http://pypi.python.org/pypi/nltk
- Install PyYAML: http://pyyaml.org/wiki/PyYAML
- Test installation: Start>Python27, then type import nltk
Source installation (for 32-bit or 64-bit Windows)¶
- Install Python: http://www.python.org/download/releases/2.7.3/
- Install Numpy (optional): http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
- Install Setuptools: http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11.win32-py2.7.exe
- Install Pip: Start>Run... c:\Python27\Scripts\easy_install pip
- Install PyYAML and NLTK: Start>Run... c:\Python27\Scripts\pip install pyyaml nltk
- Test installation: Start>All Programs>Python27>IDLE, then type import nltk