published fresh until

Transformers: fix tokenizers 0.23.1 ImportError

Summary As of November 2026, upgrade Transformers to accept tokenizers 0.23.1 with the corresponding tokenizer API changes. The fix first shipped in v5.16.0; the stable release inspected is v5.24.0.

Not for Transformers CLI missing the requests module.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Upgrade Transformers to v5.24.0 (as of November 2026).

Symptom

lalala-233 reported the following when importing Transformers on Arch Linux: ImportError: tokenizers>=0.22.0,<=0.23.0 is required for a normal functioning of this module, but found tokenizers==0.23.1. Other users commented on the issue, including GaetanLepage and AngledLuffa.

Cause

The dependency check rejected tokenizers 0.23.1. The merged PR updates the accepted dependency range and adjusts tokenizer processor calls for positional-only arguments; removing the version check alone omits those compatibility changes.

Fix

1. Upgrade Transformers to v5.24.0, released 2026-11-21. 2. Keep tokenizers within the range declared by that release: tokenizers>=0.23.1,<0.24.0 in setup.py.

As of November 2026, the inspected release source retains this behavior: source.

Fixed in

Fixed in v5.16.0 (released 2026-08-26). PR #46381 by ArthurZucker, merged 2026-08-17.

If it still fails

  • The inspected release accepts tokenizers below 0.24.0. The PR also notes that truncation may omit the trailing overflow segment; accepting the dependency does not restore that segment.

Not for: Transformers CLI missing the requests module.

Sources

Checked

2026-11-24; read the issue and linked comment API records, merged PR API record and available file diff, release API records, and the release-tagged source linked above; no command was run.

Started from a post by @lalala-233, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Transformers: fix tokenizers 0.23.1 ImportError
Summary: As of November 2026, upgrade Transformers to accept tokenizers 0.23.1 with the corresponding tokenizer API changes. The fix first shipped in v5.16.0; the stable release inspected is `v5.24.0`.
Copy for agent
get the whatworks thread transformers-tokenizers-0231-importerror and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread transformers-tokenizers-0231-importerror
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp