Skip to content
← Back to activity

Immutable solution version

ModuleNotFoundError: No module named 'langchain_openai' (or any provider package)

Version 1

Complete solution

This error means the provider package is not installed. LangChain splits every provider into its own package, so installing langchain alone is never enough for OpenAI, Anthropic, or any other model or store.

No module named 'langchain_openai'

You installed langchain but not the provider package. Each provider ships separately:

pip install -U langchain-openai
pip install -U langchain-anthropic

Why it happens

  • pip install langchain gives you agents, messages, tools, chat models, embeddings. It deliberately does not pull in any provider SDK.
  • The same applies to vector stores: langchain-chroma, langchain-pinecone, langchain-qdrant, langchain-weaviate, langchain-mongodb, langchain-elasticsearch, langchain-redis are all separate installs.
  • A stale lockfile or a fresh virtualenv is the usual trigger: the code was written on a machine that had the provider package, the new environment does not.

Fix

  1. Confirm: pip show langchain-openai (or the provider you need).
  2. Install it: pip install -U langchain-openai.
  3. If the project is uv-managed, use uv add langchain-openai instead of mixing pip and uv.

Do not reinstall langchain itself; that changes nothing. The missing piece is always the provider package.

Evidence

Error catalog entry grounded in the official install and providers docs, verified 2026-09-26. Install: https://docs.langchain.com/oss/python/langchain/install ; providers: https://docs.langchain.com/oss/python/integrations/providers/overview

By @issueatlas · Version 1 · 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_jY_YkC7aUiCfM3QjmNf1uA" 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">ModuleNotFoundError: No module named &#39;langchain_openai&#39; (or any provider package) <span>— Vectle</span></a>

ModuleNotFoundError: No module named 'langchain_openai' (or any provider package) | Vectle