---
description: In this tutorial, you will learn – Installing NLTK in Windows Installing Python in Windows Installing NLTK in Mac/Linux Installing NLTK through Anaconda NLTK Dataset How to Download all packages of NL
title: How to Download &#038; Install NLTK
image: https://www.guru99.com/images/how-to-download-and-install-nltk.png
---

[Skip to content](#main)

**⚡ Smart Summary**

Download and Install NLTK on Windows, Mac, or Linux by installing Python first, then adding the Natural Language Toolkit through pip or Anaconda and downloading the corpus datasets.

- ✅ **Requirement:** Install Python before adding NLTK.
- ⚙️ **Install:** Use pip, easy\_install, or Anaconda.
- 📚 **Datasets:** Run nltk.download() to fetch corpora.
- 🐍 **Verify:** import nltk in the Python shell.
- 🤖 **AI Use:** Tokenization and tagging for NLP pipelines.

Read More

![Download and Install NLTK](https://www.guru99.com/images/how-to-download-and-install-nltk.png)

## Installing NLTK in Windows

Learn how to set up NLTK on Windows from the command prompt. The instructions below assume Python is not installed yet, so the first step is to install Python.

### Installing Python in Windows

**Step 1)** Open the link [**https://www.python.org/downloads/**](https://www.python.org/downloads/)**,** and select the latest Windows release.

[![Installing Python in Windows]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo1.png)

**Note**: For an older version, visit the Downloads tab to see all releases.

[![Installing Python in Windows]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo2.png)

**Step 2)** Click the downloaded installer file.

[![Installing Python in Windows]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo3.png)

**Step 3)** Select Customize Installation.

[![Installing Python in Windows]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo4.png)

**Step 4)** Click NEXT.

[![Installing Python in Windows]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo5.png)

**Step 5)** On the next screen:

1. Select the advanced options.
2. Provide a custom install location. In this example, a folder on the C drive is chosen for easier access.
3. Click Install.

[![Installing Python in Windows]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo6.png)

**Step 6)** Click the Close button once the install finishes.

[![Installing Python in Windows]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo7.png)

**Step 7)** Copy the path of your Scripts folder.

[![Installing Python in Windows]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo8.png)

**Step 8)** In the Windows command prompt:

- Navigate to the location of the pip folder.
- Enter the command to install NLTK:

  ```
  pip3 install nltk
  ```

- The installation should complete successfully.

[![Installing Python in Windows]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo9.png)

**NOTE**: For Python 2, use the command `pip2 install nltk`.

**Step 9)** From the Windows Start menu, search for and open the Python Shell.

[![Installing Python in Windows]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo10.png)

**Step 10)** Verify that the installation works by running the command below:

```
import nltk
```

[![Installing Python in Windows]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo11.png)

If no error appears, the installation is complete.

**Don't Miss:**

- [NLTK Tokenize: Words and Sentences Tokenizer with Example](https://www.guru99.com/tokenize-words-sentences-nltk.html)
- [POS Tagging with NLTK and Chunking in NLP \[EXAMPLES\]](https://www.guru99.com/pos-tagging-chunking-nltk.html "POS Tagging with NLTK and Chunking in NLP [EXAMPLES]")
- [Stemming and Lemmatization in Python NLTK with Examples](https://www.guru99.com/stemming-lemmatization-python-nltk.html)
- [NLTK WordNet: Find Synonyms from NLTK WordNet in Python](https://www.guru99.com/wordnet-nltk.html)

## Installing NLTK in Mac/Linux

Installing NLTK on Mac or Linux requires the Python package manager pip. If pip is not installed, follow the instructions below to complete the process.

**Step 1)** Update the package index by typing the command below:

```
sudo apt update
```

**Step 2)** Install pip for Python 3:

```
sudo apt install python3-pip
```

You can also install pip through easy\_install:

```
sudo apt-get install python-setuptools  python-dev build-essential
```

Once easy\_install is installed, run the command below to install pip:

```
sudo easy_install pip
```

**Step 3)** Use the following command to install NLTK:

```
sudo pip install -U nltk
sudo pip3 install -U nltk

```

## Installing NLTK through Anaconda

**Step 1)** Install Anaconda by visiting https://www.anaconda.com/products/individual and selecting the Python version you need.

[![Installing NLTK through Anaconda]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo12.png)

Note: Refer to this tutorial for detailed steps to [install Anaconda](https://www.guru99.com/download-install-r-rstudio.html).

**Step 2)** In the Anaconda prompt:

1. Enter the command:

   ```
   conda install -c anaconda nltk
   ```

2. Review the package upgrade, downgrade, and install information, then enter yes.
3. NLTK is downloaded and installed.

[![Installing NLTK through Anaconda]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo13.png)

## NLTK Dataset

The NLTK module ships with many datasets that you need to download before use. Technically, each dataset is called a **corpus**. Common examples include **stopwords**, **gutenberg**, **framenet\_v15**, **large\_grammars**, **brown**, and **wordnet**.

## How to Download all packages of NLTK

**Step 1)** Run the [Python interpreter](https://www.guru99.com/execute-python-online.html) in Windows or Linux.

**Step 2)**

1. Enter the commands:

```
import nltk
nltk.download ()
```

2. The NLTK Downloader window opens. Click the Download button to fetch the dataset. This process takes time depending on your internet connection.

[![Download all Packages of NLTK]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo14.png)

**NOTE:** You can change the download location by clicking File > Change Download Directory.

[![Download all Packages of NLTK]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo15.png)

**Step 3)** To test the installed data, use the following code:

```
>>> from nltk.corpus import brown
>>>brown.words()

```

\[‘The’, ‘Fulton’, ‘County’, ‘Grand’, ‘Jury’, ‘said’, …]

[![Download all Packages of NLTK]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo16.png)

## Running the NLP Script

This section explains how an NLP script runs on a local PC. The right library choice depends on your requirements. See the official list of [NLP libraries](https://www.nltk.org/) for alternatives such as spaCy, gensim, and TextBlob.

## How to Run NLTK Script

**Step 1)** In your favorite code editor, copy the code and save the file as **NLTKsample.py**:

```
from nltk.tokenize import RegexpTokenizer
tokenizer = RegexpTokenizer(r'\w+')
filterdText=tokenizer.tokenize('Hello Guru99, You have build a very good site and I love visiting your site.')
print(filterdText)
```

[![Run NLTK Script]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo17.png)

**Code Explanation:**

1. The objective of this program is to remove every kind of punctuation from a given text. We imported “RegexpTokenizer”, a module of [NLTK](https://www.guru99.com/nltk-tutorial.html) that removes any expression, symbol, character, or numeric value you choose.
2. A regular expression is passed to the “RegexpTokenizer” module.
3. The text is tokenized using the “tokenize” method, and the output is stored in the “filterdText” variable.
4. The result is printed using “print()”.

**Step 2)** In the command prompt:

- Navigate to the location where you saved the file.
- Run the command `python NLTKsample.py`.

[![Run NLTK Script]()](https://www.guru99.com/images/1/092818_1321_HowtoDownlo18.png)

The output is:

\[‘Hello’, ‘Guru99’, ‘You’, ‘have’, ‘build’, ‘a’, ‘very’, ‘good’, ‘site’, ‘and’, ‘I’, ‘love’, ‘visiting’, ‘your’, ‘site’]

## FAQs

📦 What is the difference between installing NLTK and downloading NLTK data?

The pip command installs the library itself, while nltk.download() fetches corpora and trained models such as stopwords, punkt, and wordnet. Both steps are needed before tokenizing or tagging text.

🤖 Is NLTK still useful in the era of large language models?

Yes. NLTK remains popular for preprocessing text that feeds LLMs, including tokenization, stop-word removal, stemming, and POS tagging. It is also widely used in teaching and research thanks to its clear API and classic corpora.

🧠 How does NLTK compare with spaCy or Hugging Face Transformers for AI work?

NLTK is best for learning NLP fundamentals. spaCy is faster for production, while [Hugging Face Transformers](https://huggingface.co/transformers/) offers pretrained deep-learning models. Many AI projects combine NLTK preprocessing with transformer inference.

#### Summarize this post with:

ChatGPTPerplexityGrokGoogle AI

**Stay Updated on AI** **Get Weekly AI Skills, Trends, Actionable Advice.**

##### Sign up for the newsletter

Subscribe for Free

You have successfully subscribed.  
Please check your inbox.

![AI-Newsletter]() Chosen by over **350,000+** professionals

[Scroll to top](#wrapper)

×

Search for:

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.guru99.com/#organization","name":"Guru99","sameAs":["https://www.facebook.com/Guru99Official","https://twitter.com/guru99com"],"logo":{"@type":"ImageObject","@id":"https://www.guru99.com/#logo","url":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","contentUrl":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","caption":"Guru99","inLanguage":"en-US"}},{"@type":"WebSite","@id":"https://www.guru99.com/#website","url":"https://www.guru99.com","name":"Guru99","publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https://www.guru99.com/images/how-to-download-and-install-nltk.png","url":"https://www.guru99.com/images/how-to-download-and-install-nltk.png","width":"700","height":"248","caption":"How to Download &amp; Install NLTK","inLanguage":"en-US"},{"@type":"BreadcrumbList","@id":"https://www.guru99.com/download-install-nltk.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":"1","item":{"@id":"https://www.guru99.com","name":"Home"}},{"@type":"ListItem","position":"2","item":{"@id":"https://www.guru99.com/nltk","name":"NLTK"}},{"@type":"ListItem","position":"3","item":{"@id":"https://www.guru99.com/download-install-nltk.html","name":"How to Download &#038; Install NLTK"}}]},{"@type":"WebPage","@id":"https://www.guru99.com/download-install-nltk.html#webpage","url":"https://www.guru99.com/download-install-nltk.html","name":"How to Download &#038; Install NLTK","dateModified":"2026-10-10T16:03:39+05:30","isPartOf":{"@id":"https://www.guru99.com/#website"},"primaryImageOfPage":{"@id":"https://www.guru99.com/images/how-to-download-and-install-nltk.png"},"inLanguage":"en-US","breadcrumb":{"@id":"https://www.guru99.com/download-install-nltk.html#breadcrumb"}},{"@type":"Person","@id":"https://www.guru99.com/author/editorial","name":"Editorial Team","url":"https://www.guru99.com/author/editorial","image":{"@type":"ImageObject","@id":"https://www.guru99.com/images/favicon-new-logo.png","url":"https://www.guru99.com/images/favicon-new-logo.png","caption":"Editorial Team","inLanguage":"en-US"},"sameAs":["https://www.guru99.com/editorial-team"],"worksFor":{"@id":"https://www.guru99.com/#organization"}},{"articleSection":"NLTK","headline":"How to Download &#038; Install NLTK","description":"In this tutorial, you will learn \u2013 Installing NLTK in Windows Installing Python in Windows Installing NLTK in Mac/Linux Installing NLTK through Anaconda NLTK Dataset How to Download all packages of NL","keywords":"nltk, python, bigdata","speakable":{"@type":"SpeakableSpecification","cssSelector":[".entry-title",".summary"]},"@type":"Article","author":{"@id":"https://www.guru99.com/author/editorial","name":"Editorial Team"},"dateModified":"2026-10-10T16:03:39+05:30","image":{"@id":"https://www.guru99.com/images/how-to-download-and-install-nltk.png"},"copyrightYear":"2026","name":"How to Download &#038; Install NLTK","subjectOf":[{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is the difference between installing NLTK and downloading NLTK data?","acceptedAnswer":{"@type":"Answer","text":"The pip command installs the library itself, while nltk.download() fetches corpora and trained models such as stopwords, punkt, and wordnet. Both steps are needed before tokenizing or tagging text."}},{"@type":"Question","name":"Is NLTK still useful in the era of large language models?","acceptedAnswer":{"@type":"Answer","text":"Yes. NLTK remains popular for preprocessing text that feeds LLMs, including tokenization, stop-word removal, stemming, and POS tagging. It is also widely used in teaching and research thanks to its clear API and classic corpora."}},{"@type":"Question","name":"How does NLTK compare with spaCy or Hugging Face Transformers for AI work?","acceptedAnswer":{"@type":"Answer","text":"NLTK is best for learning NLP fundamentals. spaCy is faster for production, while Hugging Face Transformers offers pretrained deep-learning models. Many AI projects combine NLTK preprocessing with transformer inference."}}]}],"@id":"https://www.guru99.com/download-install-nltk.html#schema-1114095","isPartOf":{"@id":"https://www.guru99.com/download-install-nltk.html#webpage"},"publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US","mainEntityOfPage":{"@id":"https://www.guru99.com/download-install-nltk.html#webpage"}}]}
```
