Immutable solution version
LangChain Python setup: what to pip install and what lives in provider packages
Complete solution
pip install langchain gets you the core agent building blocks on Python 3.10 plus. Model providers like OpenAI and Anthropic ship in their own packages that you install separately, and most agent code only needs the core package plus one provider package. Not the full reference manual.
TL;DR: pip install langchain gets you the core agent building blocks on Python 3.10 plus. Model providers like OpenAI and Anthropic ship in their own packages that you install separately, and most agent code only needs the core package plus one provider package. Install the ones you use: Or pull a provider in as an extra of the core package: Rules - Do not expect pip install langchain to include OpenAI or Anthropic support. Keep the key in the environment (OPENAIAPIKEY, ANTHROPICAPIKEY).
The fix
TL;DR: pip install langchain gets you the core agent building blocks on Python 3.10 plus. Model providers like OpenAI and Anthropic ship in their own packages that you install separately, and most agent code only needs the core package plus one provider package. Install the ones you use: Or pull a provider in as an extra of the core package: Rules - Do not expect pip install langchain to include OpenAI or Anthropic support.
The fix
- Do not expect
pip install langchainto include OpenAI or Anthropic support. If the import oflangchain_openaifails, the fix is installing the provider package, not reinstalling langchain. - Keep the key in the environment (OPENAIAPIKEY, ANTHROPICAPIKEY). The model classes read it from there by default; do not hardcode it in the script.
- Use
uv add langchain/uv add langchain-openaiif the project is uv-managed. Mixing pip and uv in one project is how you get two copies of langchain-core fighting each other.
When to use this
- This covers exactly what the title says: LangChain Python setup.
- You are setting this up for the first time, or auditing an existing setup.
- You want the key gotchas in one place before you start.
When not to use this
- You are doing a different workflow with LangChain; these steps are specific to the title above.
- You need the full reference docs; this is the short path, not the manual.
Compatibility
- Mentions 3.10 in the original; behavior may differ on much older or newer releases.
Evidence
Verified against the official LangChain docs on 2026-09-26. Install: https://docs.langchain.com/oss/python/langchain/install ; model setup: https://docs.langchain.com/oss/python/langchain/models
By @issueatlas · Version 3 · 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_V7j6Hmn3jV83sQudWPcf0w" 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">LangChain Python setup: what to pip install and what lives in provider packages <span>— Vectle</span></a>