Install & Compatibility
Where this runs
tested against v1.2.11 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 2.500s · 74.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 7.8s · import 2.338s · 82MB
77MB installed
● package 77MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
StateGraph
✓ from langgraph.graph import StateGraph
Core graph primitive. Unchanged in 1.0.
create_react_agent
✓ from langchain import create_agent
✗ from langgraph.prebuilt import create_react_agent
langgraph.prebuilt deprecated in 1.0. create_react_agent moved to langchain.agents. Use create_agent from langchain instead.
MemorySaver
✓ from langgraph.checkpoint.memory import MemorySaver
In-memory checkpointer for dev/testing. Not for production.
Minimal single-node StateGraph in LangGraph 1.0.
from langgraph.graph import StateGraph, END
from typing import TypedDict
class State(TypedDict):
messages: list
def call_model(state: State):
# your LLM call here
return {"messages": state["messages"]}
graph = StateGraph(State)
graph.add_node("agent", call_model)
graph.set_entry_point("agent")
graph.add_edge("agent", END)
app = graph.compile()
result = app.invoke({"messages": [{"role": "user", "content": "hello"}]})
langgraph --version
Errors
Common errors & fixes
AttributeError: 'StateGraph' object has no attribute 'compile'
You are attempting to use a `StateGraph` object directly for execution (e.g., calling `invoke()`, `stream()`) without first compiling it into an executable `CompiledStateGraph`.
fixCall the `.compile()` method on your `StateGraph` instance before attempting to invoke or stream from it.
```python
from langgraph.graph import StateGraph, END
workflow = StateGraph(State)
# ... add nodes and edges ...
app = workflow.compile() # Add this line
# app.invoke(...)
```
ModuleNotFoundError: No module named 'langgraph.prebuilt'; 'langgraph' is not a package
This error often occurs when you have a local Python file or directory named `langgraph.py` or `langgraph` in your project's working directory, which shadows the installed `langgraph` package.
fixRename your local `langgraph.py` file or `langgraph` directory to something else (e.g., `my_langgraph_app.py`) to avoid conflicts with the installed library. Then, try your import again.
No checkpointer set
You are attempting to use state persistence features (like resuming an interrupted graph run) without configuring a checkpointer when compiling your `StateGraph`.
fixProvide a `checkpointer` instance (e.g., `SqliteSaver`) to the `compile()` method of your `StateGraph`.
```python
from langgraph.graph import StateGraph
from langgraph.checkpoint.sqlite import SqliteSaver
memory = SqliteSaver(conn='sqlite:///graph.sqlite')
workflow = StateGraph(State)
# ... add nodes and edges ...
app = workflow.compile(checkpointer=memory)
```
Invalid parameter: messages with role 'tool' must be a response to a preceeding message with 'tool_calls'.
This error occurs when the sequence of messages in your agent's state doesn't correctly follow the tool-calling protocol, specifically when a tool output message (`role='tool'`) is not immediately preceded by an AI message containing `tool_calls`.
fixEnsure that your graph's state updates maintain the correct conversational turn structure: an AI message with `tool_calls` must be followed by one or more tool messages responding to those specific tool calls before any other AI or human messages are added.
ImportError: cannot import name 'ServerInfo' from 'langgraph.runtime'
This error typically indicates a version incompatibility, where `langgraph-prebuilt` or another `langgraph` extension package is trying to import a symbol (`ServerInfo`) from `langgraph.runtime` that does not exist in your currently installed `langgraph` core library version.
fixEnsure that all `langgraph` related packages (`langgraph`, `langgraph-prebuilt`, etc.) are updated to their latest compatible versions. Use `pip install -U langgraph langgraph-prebuilt` (or specific versions if a known compatible set exists).
Upgrade
Version history
1.2.11latest on PyPI · released Aug 11, 2026
Audit
Dependencies
langchainoptionalRequired for high-level agent abstractions built on LangGraph runtime.
langgraph-checkpoint-sqliteoptionalRequired for persistent checkpointing with SQLite. Use for local dev.
langgraph-checkpoint-postgresoptionalRequired for persistent checkpointing with Postgres. Use for production.