Installing NLTK on Windows 10

In this tutorial we are going to install NLTK on Windows 10 with the pip tool.

Installing NLTK on Windows 10

Installing NLTK on Windows 10 with pip

In this tutorial we are going to explains you the steps to install NLTK library on Windows 10 with the pip tool and teach you download all data necessary to learn NLTK. The NLTK library is a NLP library written in Python and it required Python environment to run programs. So, before installing NTLK Python must be installed on your Operating System.

To run NLTK you have should have at least Python 2.7 installed on your computer. If you already not installed Python on your computer then download and installed it on your computer. We are using 3.5 for this tutorial.

You can easily download Python installer on for windows 10 and then install it on your computer.

The pre-requisite for installing NLTK are:

  • Python 2.7 or above
  • pip tool

Once these tools are install we can proceed to install NLTK on Windows 10.

Here are steps to install NLTK on Windows 10.

We have also created step by step video tutorial for installing NLTK on Windows 10. Here is the video:

1. Python 2.7 or above

Python 2.7 or above must be installed on your computer, in my case Python 3.5.2 is installed. To check which version of Python is installed run the following command in command prompt:

python --version

Make sure you have Python 2.7 or above.

2. Install numpy

NLTK needs nympy as dependency, and you can install it with following command:

pip install numpy

3. Installing NLTK on Windows

Now run the following pip command to install nltk on your windows machine:

pip install nltk

Above command will install NLTK on your windows computer.

4. Test NLTK installation

Now you can test your installation of NLTK by opening python interpreter with following command:

python

And then run following import:

import nltk

You should be able to run above line in python interpreter if NLTK is install correctly.

5. Download and install NLTK data

Now you should download and install the NLTK data and its easy. Open python interpreter and execute following code:

import nltk
nltk.download()

This will open GUI window as shown below:

Installing NLTK on Windows 10

Click on the "Download" window in the above window to install NLTK data. After completion of download click cross in the window "X" to close window. You can see all steps in the video tutorial embedded in this page.

Step 6: Check NLTK data

Now open python interpreter if it is not open and then run following code:

from nltk.corpus import brown
brown.words()

Above command will show following output:

>>> from nltk.corpus import brown
>>> brown.words()
['The', 'Fulton', 'County', 'Grand', 'Jury', 'said', ...]
>>>

Congratulations!!! You have successfully installed NLTK on your Windows computer.

In this tutorial you learned how to install NLTK on Windows 10. 0