You need a working LLM app framework on the machine today – not another overview. Stale pins and moved imports kill more first agents than missing API keys. Clean path to LangChain 1.4.0, the stable Python release as of September 3, 2026 on PyPI.
Treat it as a deployable dependency. Skip the tour.
System requirements for LangChain 1.4.0
Interpreter first. Core package is light; local models and vector stores are what blow the box up later.
| Component | Minimum | Recommended |
|---|---|---|
| Python | 3.10 | 3.11 or 3.12 (quickstart examples pin 3.11) |
| Package manager | pip | uv (faster resolver; shows up in current quickstarts) |
| OS | Linux / macOS / Windows | Linux or macOS for long-running agents |
| Network | PyPI access | Stable outbound HTTPS for model providers |
PyPI classifiers lock the range to Python >=3.10.0, <4.0.0. No GPU for the framework itself.
Official download source
- PyPI:
langchain– pypi.org/project/langchain - Install docs: docs.langchain.com/…/install
- Monorepo: github.com/langchain-ai/langchain
Skip mirrors and leftover 0.3.x wheels. On the JS side it’s npm install langchain @langchain/core (Node 22+ per the JS install docs). Rest of this page is Python only.
Step-by-step install (uv preferred)
Fresh virtualenv. Global site-packages plus 1.x is how resolver fights start.
- Confirm the interpreter:
python3 --version(must read 3.10+). - Project bootstrap the uv way (matches current quickstart style):
uv python pin 3.11
uv init langchain-app
cd langchain-app
uv add langchain
uv sync
Plain pip:
python3 -m venv .venv
source .venv/bin/activate # Windows: .venvScriptsactivate
python -m pip install --upgrade pip
pip install -U langchain
Provider packages are separate. Pull what you call:
uv add langchain-openai
# or
pip install -U langchain-openai
pip install -U "langchain[openai]"
# MCP (ships in 1.4 via extra):
pip install -U "langchain[mcp]"
Old tutorial code that still imports chains? Optional only:
pip install langchain-classic
Pin production like
langchain>=1.4,<2. A 2.0 break should not land unannounced. Inside 1.x, keep minors aligned across langchain / langchain-core / community packages.
First-time configuration
Bare config = env vars. No YAML for a first agent.
export OPENAI_API_KEY="sk-..."
# or ANTHROPIC_API_KEY / GOOGLE_API_KEY / OLLAMA_API_KEY
export LANGSMITH_TRACING="true"
export LANGSMITH_API_KEY="..."
Prefer files? Load a .env with python-dotenv. Model strings look like openai:gpt-... or anthropic:claude-... once the matching integration package is present.
Verify the install works
Two checks – version, then a real import path.
python -c "import langchain; print(langchain.__version__)"
# expect 1.4.0 (or the exact build you pulled)
Smoke agent (needs a provider key + its package):
from langchain.agents import create_agent
def ping(city: str) -> str:
"""Return a fixed status string."""
return f"reachable:{city}"
agent = create_agent(
model="openai:gpt-4o-mini", # swap for your model string
tools=[ping],
system_prompt="Be brief.",
)
print(agent.invoke({"messages": [{"role": "user", "content": "ping London"}]}))
Message list back, no import/auth errors → framework is live. Print(version) alone lies when classic imports still point at the wrong package.
Here’s the part install pages gloss over: the core wheel stays small on purpose. “It installed” never means “my 2024 notebook still runs.” That split is the migration cost – budget an hour for import rewrites, not five minutes for pip.
Common install errors and fixes
The catch is almost never the happy-path command. It’s leftovers.
ModuleNotFoundError: No module named ‘langchain.chains’ (same family: .retrievers, hub). You’re on 1.x; those modules left the main package. Install langchain-classic, then from langchain_classic.chains import .... New work should target create_agent instead. Community threads and the v1 notes both describe this path.
pip dependency conflicts after a partial upgrade. Old langchain-community==0.2.x pins fighting langchain-core 1.x show up constantly. Delete the venv. Reinstall only aligned 1.x packages.
LangChainBetaWarning on langchain.mcp. Expected on 1.4 with the built-in adapter (pip install "langchain[mcp]"). API can still move. If you came from langchain-mcp-adapters / MultiServerMCPClient, switch toward MCPAdapter and skim the Sep 2026 changelog.
Upgrade and uninstall
pip install -U langchain langchain-core
# or: uv lock --upgrade-package langchain && uv sync
Pre-1.0 → import rewrites plus optional classic. 1.3 → 1.4 with MCP in play → add the mcp extra and drop the old adapters package.
pip uninstall -y langchain langchain-core langgraph langchain-classic langchain-openai
# cleanest: rm -rf .venv
Library only. No leftover daemon or Docker service.
When is classic still worth keeping around after the agent path works? If a vendor sample or internal notebook still speaks RetrievalQA – sure, side by side. If every path is already create_agent, drop it and shrink the tree.
FAQ
Do I need Docker for LangChain?
No. Python package. Containerize your app later if you want.
Why does my old RetrievalQA import fail after a fresh 1.4 install?
Same classic split as the errors section: chains left the main package at 1.0. Install langchain-classic, change the prefix, or rewrite onto agents. Holding both packages during a transition is normal.
Should I always install the mcp extra?
Only when you talk to Model Context Protocol servers. Base langchain stays smaller without it. When you need it, pin langchain[mcp]>=1.4.0. You’ll get the beta warning on langchain.mcp until that namespace settles – don’t silence it and forget; the adapter surface can still shift relative to the old standalone client.
Next: version check + the ping agent in a clean venv. Once that prints, wire real tools and turn on LangSmith tracing.