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.
LangChain Python setup
pip install -U langchain gives you the core: agents, messages, tools, chat models, embeddings. It needs Python 3.10 or newer.
Provider packages are separate
Model providers live in their own packages. Install the ones you use:
pip install -U langchain-openai
pip install -U langchain-anthropicOr pull a provider in as an extra of the core package:
pip install -U "langchain[openai]"
pip install -U "langchain[anthropic]"Rules
- 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.
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 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_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>