## TL;DR
Newer NLTK versions renamed the Punkt tokenizer data from `punkt` to `punkt_tab`. Run `nltk.download('punkt_tab')` once, or pin it in your Docker/CI setup so every environment has it.

## Error
```text
LookupError:
**********************************************************************
  Resource punkt_tab not found.
  Please use the NLTK Downloader to obtain the resource:
  download it with: nltk.download('punkt_tab')
**********************************************************************
```

## Steps

1. Download the renamed resource:
```python
import nltk
nltk.download('punkt_tab')
```
Expected output: the downloader fetches punkt_tab and `nltk.word_tokenize("hello world")` works immediately after.

2. Pin it for Docker and CI so the download is not interactive:
```dockerfile
RUN python -m nltk.downloader punkt_tab -d /usr/local/share/nltk_data
```
Expected output: the image contains the tokenizer data and containers never hit the LookupError.

3. If NLTK cannot find its data dir, point it at the right one:
```python
import nltk
nltk.data.path.append("/usr/local/share/nltk_data")
```
Expected output: `nltk.data.find("tokenizers/punkt_tab")` resolves instead of raising.

4. Do not "fix" this by downloading the old `punkt` package alone. On NLTK 3.8.2+ the tokenizer asks for `punkt_tab` specifically and the old id will not satisfy it.
Expected output: one download, no confusion between the two similarly named resources.

## When to use
- `word_tokenize` or `sent_tokenize` raise Resource punkt_tab not found
- Setting up NLTK in Docker, CI, or serverless where data is not preinstalled
- You upgraded NLTK and tokenization broke

## When not to use
- Other missing resources (stopwords, wordnet, averaged_perceptron_tagger) each need their own download
- You are on NLTK older than 3.8.2 and see "punkt not found" (download `punkt` there)
- Tokenization is slow but works (thats performance, not a missing resource)

## Variant phrasings

### "Resource punkt not found" on older NLTK
Same fix, old name: `nltk.download('punkt')`. The rename is what causes the confusion across versions.

### punkt_tab missing in AWS Lambda or serverless
Bundle the data dir into the deployment package and append it to `nltk.data.path`; there is no writable home to download into at runtime.

## Why it happens
NLTK 3.8.2 restructured the Punkt tokenizer tables into a tabular format and published them under the new `punkt_tab` id. The tokenizer code requests the new id, so environments provisioned with only the old `punkt` package fail the lookup.

## Edge cases
- Read-only filesystems: download at build time, never at request time.
- Multiple Python environments on one machine each need the data on their own `nltk.data.path`.
- Fully offline machines: copy a `nltk_data` directory in from a connected machine instead of downloading.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_cuXMOkWm-RoH-qqB94DQGw
