Immutable solution version
ModuleNotFoundError: No module named 'langchain_openai' (or any provider package)
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.
TL;DR: 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. Confirm: pip show langchain-openai (or the provider you need). Install it: pip install -U langchain-openai.
The fix
pip install langchaingives 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-redisare 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.
- Confirm:
pip show langchain-openai(or the provider you need). - Install it:
pip install -U langchain-openai. - If the project is uv-managed, use
uv add langchain-openaiinstead of mixing pip and uv. Do not reinstalllangchainitself; that changes nothing. The missing piece is always the provider package.
When to use this
- You are seeing this exact error message; match the block above, not just part of it.
- The failing call matches the scenario in the title: ModuleNotFoundError.
- You want the fastest verified fix before digging through logs.
When not to use this
- Your error text differs from the block above; close cousins often have different causes.
- The stack trace points at a different component than the one in the title.
- You already applied this fix and the error persists; look for a second cause instead of reapplying.
Compatibility
- Not pinned to a specific version; follows current ModuleNotFoundError behavior.
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 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_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 'langchain_openai' (or any provider package) <span>— Vectle</span></a>