NLTK / Data download errors

Causes and fixes for NLTK data download errors

Common errors when downloading tokenizers, stopwords and other data with nltk.download, listed by exact message, each with its cause and fix.

Short answer

NLTK tokenizers, stopwords and other data do not come with pip and must be downloaded with nltk.download, and since 3.8.2 punkt was replaced by punkt_tab, so a mismatched data name or an unreachable downloader makes code fail with LookupError.

Setting up your environment this way avoids most errors on this page.

PracticeWhat happens if you skip it
Use NLTK 3.9.1 or later and download punkt_tab for tokenization.A mismatched version and data name gives Resource punkt_tab not found or Resource punkt not found.
Download the data you need once into a fixed folder and put that folder in the NLTK_DATA environment variable.The data is missing on another machine, under another user or after deployment.
Deployed apps should call nltk.download at startup with download_dir set to a writable folder.It runs locally but fails with LookupError after deployment.
For manual downloads, place files in category folders such as nltk_data/tokenizers and nltk_data/corpora.Files unzipped into the nltk_data root are still not found.
Do not turn off Python HTTPS certificate verification to get around certificate errors.Every HTTPS request in the process stops verifying certificates, which is a security risk.

Troubleshooting by error message

Find your exact error message. Each entry gives the cause, the fix, and what may come up after the fix.

LookupError: Resource punkt_tab not found. Please use the NLTK Downloader to obtain the resource:

Cause: Since NLTK 3.8.2 the tokenizer uses punkt_tab, and a previously downloaded punkt is no longer used. The rename happened because the old punkt data was unsafe pickle files.

Fix: Run import nltk; nltk.download("punkt_tab").

What may come next: For part-of-speech tagging, averaged_perceptron_tagger was likewise replaced by averaged_perceptron_tagger_eng and must be downloaded again.

LookupError: Resource punkt not found. Please use the NLTK Downloader to obtain the resource:

Cause: The environment has an NLTK older than 3.8.2, which needs punkt, but punkt_tab was downloaded.

Fix: Upgrade NLTK to 3.9.1 or later and download punkt_tab; if you cannot upgrade yet, download punkt.

What may come next: Staying on 3.8.1 or older keeps the pickle security problem of punkt.

[nltk_data] Error loading punkt: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate

Cause: Python cannot verify the NLTK data server certificate, common on corporate networks or with a macOS Python that has no root certificates installed.

Fix: Download the package manually from https://www.nltk.org/nltk_data/ and unzip it into the matching category folder under nltk_data, or rerun nltk.download on another network.

What may come next: The widely shared ssl._create_unverified_context trick gets past the error but turns off certificate checks for the whole process.

nltk.download() hangs for a long time or fails with urlopen error

Cause: NLTK data packages are hosted on raw.githubusercontent.com, which some networks cannot reach.

Fix: If you need a proxy, call nltk.set_proxy("http://proxy:port") first; or download on a machine that can reach GitHub and copy the files into your nltk_data folder.

Still Resource ... not found after unzipping a package manually

Cause: The package is not in a category subfolder. NLTK only looks under folders such as nltk_data/tokenizers and nltk_data/corpora.

Fix: Create the category folder for the package, for example unzip punkt_tab into nltk_data/tokenizers/punkt_tab; some corpora must stay zipped, as the official page describes.

LookupError ... Searched in: - '/home/appuser/nltk_data' ... (after deploying to Streamlit or similar)

Cause: The data was only downloaded on your machine and is not in the server's nltk_data folder.

Fix: Call nltk.download("punkt_tab", download_dir="./nltk_data") at app startup and add that folder to nltk.data.path.

What may come next: On some platforms the default data folder is not writable, so download_dir must be a writable folder inside the app.

Scientify is a cloud computer with research software installed and AI agents such as Codex and Claude Code built in. Describe what you need in one sentence, for example "tokenize these English user reviews, remove stopwords and score each review's sentiment with VADER", and the agent uses the preinstalled NLTK to do the text processing and analysis, with no software to install and no code to write.

Compared with installing more on your own computer, the cloud computer already has NLTK 3.10.4 with WordNet, OMW, CMUdict, VADER and other common data preloaded, and other packages download directly with nltk.download without connection failures, and runs continue after you close your laptop.

The cloud computer comes with more computing power: CPU and GPU clusters can be called on demand for large-scale scientific computing. Compute is billed by the minutes you actually use, so nothing is wasted.

Cloud computer
4 vCPU · 8 GB
Top configuration, for data processing and small to medium jobs
Callable GPU
96 GB VRAM
Up to an RTX PRO 6000 per GPU; H800 80 GB and up to 8 × A10G also available
Callable CPU
224 cores · 3 TB
Largest spec, for large parallel computations

References

Frequently asked questions

What is the difference between punkt and punkt_tab?

They are the same tokenizer model. punkt was stored as pickle files, which is a security risk; since NLTK 3.8.2 it uses the punkt_tab text format. Recent NLTK only needs punkt_tab.

Where does NLTK download data by default?

To nltk_data in your home folder; system folders such as /usr/share/nltk_data or C:\nltk_data also work, or set NLTK_DATA.

Can I download all the data at once?

python -m nltk.downloader all does that, but it is several GB, so usually download only the packages you use.

Do text analysis with Scientify without setup

Upload your data, describe the computation, and Scientify runs it on a cloud computer that is already set up. New accounts get a free cloud computer and US$5 in credit.