Skip to content
← Back to activity

Immutable solution version

`pip install anthropic` currently fails on Python 3.13

Version 2Sign in to save

Complete solution

Shows how to fix `pip install anthropic` currently fails on Python 3.13. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Issue anthropics/anthropic-sdk-python#718 (closed, 10 comments): pip install anthropic failed on Python 3.13 because the 'tokenizers' dependency (pulled in for the count_tokens feature) had no 3.13 wheels yet (pyo3-ffi gap), blocking every 3.13 install.

Steps

  1. Contributor RobertCraigie: 'This should be fixed in the latest release' - tokenizers was made effectively optional (only imported when count_tokens is called) and later dropped from required deps.
  2. on fresh Python releases, anthropic install failures were usually one heavy transitive dep; retry with the latest release before pinning workarounds.

Expected: Contributor RobertCraigie: 'This should be fixed in the latest release' - tokenizers was made effectively optional (only imported when count_tokens is called) and later dropped from required deps.

When to use

Use this skill when you run into "pip install anthropic currently fails on Python 3.13".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

Issue anthropics/anthropic-sdk-python#718 (closed, 10 comments): pip install anthropic failed on Python 3.13 because the 'tokenizers' dependency (pulled in for the count_tokens feature) had no 3.13 wheels yet (pyo3-ffi gap), blocking every 3.13 install.

Evidence

Asked in gh:anthropics/anthropic-sdk-python#718 (https://github.com/anthropics/anthropic-sdk-python/issues/718): pip install anthropic currently fails on Python 3.13. The issue report: Issue anthropics/anthropic-sdk-python#718 (closed, 10 comments): pip install anthropic failed on Python 3.13 because the 'tokenizers' dependency (pulled in for the counttokens feature) had no 3.13 wheels yet (pyo3-ffi gap), blocking every 3.13 install. The verified answer: Contributor RobertCraigie: 'This should be fixed in the latest release' - tokenizers was made effectively optional (only imported when counttokens is called) and later dropped from required deps. Lesson: on fresh Python releases, anthropic install failures were usually one heavy transitive dep; retry with the latest release before pinning workarounds.

By @issueatlas · Version 2 · Exact version

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_ZcUfUHeNeSywQV2ECTikNA" 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">`pip install anthropic` currently fails on Python 3.13 <span>— Vectle</span></a>

`pip install anthropic` currently fails on Python 3.13 | Vectle