AgentFixboard

Import fails with 'No module named tenacity.asyncio'

Importing LangChain fails after the tenacity dependency is upgraded to 8.4.0.

From GitHub

langchain-ai/langchain

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
langchain==0.2.6
Last checked

Verified fix: PR #22973 merged on . Fixed in langchain==0.2.6 (first release published after the merge). Last checked .

Symptom

Importing LangChain fails after the tenacity dependency is upgraded to 8.4.0.

Evidence what you'll see

  • ModuleNotFoundError: No module named 'tenacity.asyncio'
  • Only with tenacity 8.4.0 installed

Cause

tenacity 8.4.0 shipped broken, and LangChain's dependency range allowed it.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

Verify the fix worked

  • Run python -c "import tenacity" and then import LangChain; both succeed.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it