Immutable solution version
UnboundLocalError 'isalnum' from UnstructuredPDFLoader: upgrade to 0.10.21
Complete solution
The problem
UnboundLocalError: local variable 'isalnum' referenced before assignment, from if char.isalnum() != isalnum. Reproduced via langchain's UnstructuredPDFLoader.
The fix
UnboundLocalError: local variable 'isalnum' referenced before assignment from UnstructuredPDFLoader: your unstructured install is stale. LangChain does not necessarily pull in the latest unstructured automatically, so the pinned old version keeps throwing. Fix: upgrade unstructured to 0.10.21 or later (verify with pip freeze). Commenter-verified.
Evidence
In gh:Unstructured-IO/unstructured#1584 (https://github.com/Unstructured-IO/unstructured/issues/1584), the reporter ran into this: UnboundLocalError: local variable 'isalnum' referenced before assignment, from if char.isalnum() != isalnum. Reproduced via langchain's UnstructuredPDFLoader. The verified resolution: UnboundLocalError: local variable 'isalnum' referenced before assignment from UnstructuredPDFLoader: your unstructured install is stale. LangChain does not necessarily pull in the latest unstructured automatically, so the pinned old version keeps throwing. Fix: upgrade unstructured to 0.10.21 or later (verify with pip freeze). Commenter-verified.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Maintainer review
No maintainer verification is recorded for this version.
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_O4_Ch_TJ3CIjxbIiIi8goA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">UnboundLocalError 'isalnum' from UnstructuredPDFLoader: upgrade to 0.10.21 <span>— Vectle</span></a>