Download
From NLTK
Contents |
CD-ROM
An ISO image is available, containing all the packages listed on this page. You can burn this image to CD and share it with others.
Windows
You will need to obtain the following packages from the specified URL or from the win folder of the CD-ROM. Install these on your computer using an administrator account:
- Python: http://www.python.org/ftp/python/2.5.2/python-2.5.2.msi
- NLTK: http://prdownloads.sourceforge.net/nltk/nltk-0.9.5.win32.exe
- Data: http://prdownloads.sourceforge.net/nltk/nltk-data-0.9.5.zip
The following optional packages are used by some NLTK modules:
- Numpy: http://prdownloads.sourceforge.net/numpy/numpy-1.1.1-win32-superpack-python2.5.exe
- Matplotlib: http://prdownloads.sourceforge.net/matplotlib/matplotlib-0.98.3.win32-py2.5.exe (plus an extra DLL http://www.dll-files.com/dllindex/dll-files.shtml?msvcp71)
- Prover9: http://www.cs.unm.edu/%7Emccune/prover9/gui/Prover9-Mace4-v05-setup.exe
Data: Unpack the data using a utility such as Winzip, and move the unzipped folder to C:\nltk_data. (If the data folder that you created is not in this default location then you will need to set the NLTK_DATA environment variable: right click on "My Computer", select Properties > Advanced > Environment Variables > User Variables > New..., then type NLTK_DATA into the Variable field, and type the path to the NLTK data folder that you created into the Value field.)
Known Installation Problem: The wordnet distribution \nltk_data\corpora\wordnet.zip needs to be unzipped before it can be accessed from NLTK.
Macintosh
Open Finder > Applications and check for a version of MacPython; if it is older than version 2.4 you will need to install a newer version of Python, before installing the other packages. These are available from the specified URL or from the mac folder of the CD-ROM.
- Python: http://www.python.org/ftp/python/2.5.2/python-2.5.2-macosx.dmg
- NLTK + Data: http://prdownloads.sourceforge.net/nltk/nltk-0.9.5.dmg (Tiger and Leopard)
The following optional packages are used by some NLTK modules:
- Numpy: http://prdownloads.sourceforge.net/numpy/numpy-1.1.1-py2.5-macosx10.5.dmg (Tiger)
- Matplotlib: http://pythonmac.org/packages/py25-fat/dmg/matplotlib-0.91.1-py2.5-macosx10.4-2007-12-04.dmg
- http://www.cs.unm.edu/%7Emccune/prover9/gui/Prover9-Mace4-v05B.zip
(If unable to "import nltk" after installing, do cd /tmp/nltk-installer; sudo python setup.py install - this issue arises if the NLTK installer could not locate a suitable version of Python on your machine, or if you have more than one version installed)
Known Installation Problem: The wordnet distribution /usr/share/nltk_data/corpora/wordnet.zip needs to be unzipped before it can be used accessed from NLTK.
Note that a MacPort exists for NLTK, py25-nltk, but we recommend that you use the above DMG file for now since it installs NLTK plus the required data, unlike the MacPort which only installs the software.
Linux/Unix
NLTK requires Python 2.4 or later (check with python -V). If you need to install Python, you can do this using your favorite package manager, or find a suitable RPM, or download and build Python from source (or obtain it from the unix directory of the CD-ROM).
The following optional packages are used by some NLTK modules:
- Numpy: http://prdownloads.sourceforge.net/numpy/numpy-1.1.1.tar.gz
- Matplotlib: http://prdownloads.sourceforge.net/matplotlib/matplotlib-0.98.3.tar.gz
- http://www.cs.unm.edu/%7Emccune/prover9/gui/p9m4-v05.tar.gz
Install these by unpacking the source distribution and running sudo python setup.py install
Now proceed with NLTK Source Installation (below).
NLTK Source Installation
These instructions are for Mac, Linux and Unix platforms.
Check your Python installation is adequate: open a terminal and type python -V to see what version you get; once you get the python prompt type import numpy to check you can load the numerical library (set your PATH and PYTHONPATH environment variables if necessary).
1. Download the NLTK source distribution:
Unpack the archive (e.g. with gunzip or Stuffit Expander); this will create a new folder nltk-0.9.5. Open the terminal and cd into this new folder, and type
sudo python setup.py install
(If you are using Mac OS, when you are prompted for your password, use the password that you use to login to your machine.) Once you have done this installation step you can remove the nltk-0.9.5 folder.
2. Next, download the NLTK Data distribution: http://prdownloads.sourceforge.net/nltk/nltk-data-0.9.5.zip
Unpack this archive to extract a folder called nltk_data, and move this into /usr/share or ~. If a directory of this name already exists in that location you will need to remove it first.
Assuming you are in the directory where you unpacked the nltk_data zip archive, give the commandsudo mv nltk_data /usr/share/.
Next, in order to make sure that the data files are readable, type
sudo chmod -R a+r /usr/share/nltk_data
If you installed the data as /usr/share/nltk_data, just test your installation as described in the next step. If you installed it somewhere else, however, you will need to set an environment variable to refer to this location, using a statement of the form
export NLTK_DATA=/path/to/your/nltk_dataIf you know how to edit your .bash_profile or .bashrc file, just add a version of the above line, where /path/to/your/nltk is replaced with the path to your nltk_data directory. Alternatively, type the following commands:
echo export NLTK_DATA=/path/to/your/nltk_data >> ~/.bashrc source ~/.bashrc
Known Installation Problem: The wordnet distribution /path/to/your/nltk_data/corpora/wordnet.zip needs to be unzipped before it can be used accessed from NLTK.
3. Now you should be done. In order to check that the installation is working OK, try the following in the python interactive interpreter:
>>> import nltk >>> nltk.corpus.brown.words()
You should see several lines of text.
Debian Installation
NLTK is available as a Debian package from the following URL (not always most recent version):
Installation to Non-Standard Location
If you don't want to install NLTK in a central location, download and unpack the zip distributions:
- http://prdownloads.sourceforge.net/nltk/nltk-0.9.5.zip
- http://prdownloads.sourceforge.net/nltk/nltk-data-0.9.5.zip
Move NLTK to the desired location, then add this location to your PYTHONPATH. Similarly, move the NLTK data to the desired location, and set this location as the value of NLTK_DATA
Downloading the Documentation
You can download all of the documentation (book, API docs, presentation slides), as a single zip file, from:



