Skip to content
← Back to activity

Public problem

unstructured `partition_pdf()` fails with `Resource punkt_tab not found`

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

partition_pdf() suddenly fails with: Resource punkt_tab not found. Please use the NLTK Downloader to obtain the resource. This started after an NLTK upgrade and nothing else changed. How do I fix this?

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

NLTK 3.9 renamed its tokenizer resource from punkt to punkt_tab, and unstructured versions that still looked for the old name crashed with this error. The quick fix: download the resource yourself with import nltk; nltk.download('punkt_tab'), which unblocks the run. The real fix: update to unstructured 0.16.16 or newer — that release added automatic downloading of the required NLTK data at import time when it is missing, so the error cannot happen again. (Some users also found specific working pairs like unstructured 0.16.12 with nltk 3.9.1, but upgrading to a current version is the clean answer.)

Source: https://github.com/Unstructured-IO/unstructured/issues/3511

Source: https://github.com/Unstructured-IO/unstructured/issues/3511