How to Install nltk in Python
Natural Language Toolkit
pip install nltk
What is nltk?
Natural Language Toolkit
The Natural Language Toolkit (NLTK) is a Python package for natural language processing. NLTK requires Python 3.10, 3.11, 3.12, 3.13, or 3.14.
Quick Start
Minimal example to get started with nltk:
import nltk
print(nltk.__version__)
Installation
pip (standard)
pip install nltk
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install nltk
pip3
pip3 install nltk
conda
conda install -c conda-forge nltk
Poetry
poetry add nltk
Dependencies
Installing nltk will also install these packages:
Verify the Installation
After installing, confirm the package is available:
python -c "import nltk; print(nltk.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing nltk with pip.
ModuleNotFoundError: No module named 'nltk'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install nltk. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'nltk' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install nltk to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'nltk'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show nltk and upgrade with pip install --upgrade nltk.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install nltk. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user nltk
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org nltk
MemoryError when loading data
Cause: Dataset is too large to fit in RAM.
Fix: Read in chunks, filter columns on load, or consider Polars/Dask for out-of-core processing.
Recent Releases
| Version | Released |
|---|---|
3.9.4 latest |
2026-03-24 |
3.9.3 |
2026-02-24 |
3.9.2 |
2025-10-01 |
3.9 |
2024-08-18 |
3.9.1 |
2024-08-18 |
Manage nltk
Upgrade to latest version
pip install --upgrade nltk
Install a specific version
pip install nltk==3.9.4
Uninstall
pip uninstall nltk
Check what is installed
pip show nltk