Software License

Feedback

This site is maintained by Steven Bird.

Download

Although Python 3.0 is now available, many packages that NLTK requires do not have distributions for Python 3.0.  For now you should use NLTK with Python 2.4.*, 2.5.*, or 2.6.* only.

NB. 2.0b9 will not work with Python 2.4 (to be fixed for 2.0 final).

After installing the software you should also install the data.

Windows

You will need to obtain the following packages and install them on your computer using an administrator account:

The following optional packages are used by some NLTK modules, you can install them later if you find that you need them:

Mac OS X

Before installing any new packages for NLTK, check whether you have a sufficiently recent version of Python. First, open a terminal window (Applications > Utitlities > Terminal) and type python -V in the window (NB this is a capital V). You should get back a message that looks something like Python 2.3.5.  This shows that your version of Python (possibly the version that comes pre-installed on Mac OS X) is version 2.3.5, which means that you need to install a newer version. However, if the version number is of the form 2.4.*, 2.5.* or 2.6.*, then proceed with the steps below on installing PyYAML and NLTK. If you need to upgrade your version of Python, you have two main options. First, you can get the latest 2.6.* version of MacPython:

After downloading it,  install the disk image file like other Mac OS X applications by double-clicking on the package icon.

Alternatively, if you use MacPorts, then you can open a terminal window and type sudo port install python26.  After doing this, get NLTK by typing sudo port install py26-nltk.  This will install NLTK 2.0b9 and should also fetch all its required packages, including Numpy, PyYAML, and Matplotlib. Note that py25-nltk and py-nltk (for Python 2.4) are also available.  

If you are not using MacPorts, and have checked for the presence of a sufficiently recent version of Python, then you should install two further packages at this point. First, download PyYAML:

We'll assume that this has downloaded into your Downloads folder. In a Finder window, you can unpack the archive PyYAML-3.09.tar by double-clicking it; this will create a new folder called PyYAML-3.09. In order to install PyYAML, you will need to open a terminal window, and change directory by typing cd Downloads/PyYAML-3.09. Now type sudo python setup.py install. Finally, download and install NLTK:

In order to test whether NLTK has been installed correctly, check whether you can import NLTK into your Python session. If you are running MacPython, start up IDLE, Python's Integrated Development intervface, with Applications > MacPython 2.6 > IDLE. Alternatively, open a terminal window, and type python. Now, type import nltk at the Python >>> prompt. If the prompt returns silently, then your installation was successful. If not, try the Troubleshooting suggestion given below.

The following optional packages are used by some NLTK modules; you can install them later if you find that you need them, and if they weren't already installed automatically:

Install the dmg packages in the usual way.  Install Prover9 by unpacking and building the distribution, then move it to a standard location such as /usr/share/prover9, and set the PROVER9HOME environment variable to /usr/share/prover9/bin.

Troubleshooting

It is possible that the NLTK installer gives an error message like "Errors occurred. Try installing again." This may indicate that the NLTK installer could not locate a suitable version of Python on your machine, or that you have more than one suitable version of Python installed. In this case, open a terminal window, type cd /tmp/nltk-installer and then type sudo python setup.py install.

Linux/Unix

NLTK is included in Ubuntu 10.4 (Lucid Lynx).  Get it with: sudo apt-get install python-nltk

NLTK requires Python 2.4.*, 2.5.*, or 2.6.* (check with python -V).  In the unlikely event that 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.

The following optional packages are used by some NLTK modules, you can install them later if you find that you need them.  Use your package manager to install numpy, pyyaml, and matplotlib, or download them:

Install Numpy and Matplotlib by unpacking the source distribution and running sudo python setup.py install
Install Prover9 following the instructions in the Macintosh section above.

OpenSUSE: install the python-nltk package in the "devel:languages:python" repository (more info).

Now proceed with NLTK Source Installation (below).

NLTK Source Installation

These instructions are for Mac OS X, 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).

Download the NLTK source distribution:

Unzip the archive; this will create a new folder nltk-2.0b9. Open the terminal and cd into this new folder, and type

sudo python setup.py install

Once you have done this installation step you can remove the nltk-2.0b9 folder and the zip file.

Debian Installation

NLTK is available as a Debian package from the following URL:

Installation to Non-Standard Location

If you don't want to install NLTK in a central location, download and unpack the zip distribution:

Move NLTK to the desired location, then add this location to your PYTHONPATH

Older versions

Older versions of NLTK are available at:


  Sign in   Recent Site Activity   Terms   Report Abuse   Print page  |  Powered by Google Sites