Long-running agents often need durable execution, branching, streaming, or human checkpoints rather than a single model call. LangGraph provides the low-level graph runtime and a Python Graph API without requiring a model provider or API key.
The package is published on PyPI as langgraph and requires Python 3.10 or newer. An isolated .venv keeps its dependencies out of the system Python installation and makes the active interpreter unambiguous.
The base install is enough to import StateGraph and build model-free graphs. Model providers and higher-level LangChain agent components use separate packages, so install them only when a project needs them.
Related: Build a state graph in LangGraph
Steps to install LangGraph with pip:
- Confirm that Python 3.10 or newer is available.
$ python3 --version Python 3.14.4
- Create an isolated project environment in .venv.
$ python3 -m venv .venv
- Activate the .venv environment for the current shell.
$ source .venv/bin/activate
- Install the current LangGraph package from PyPI.
$ python -m pip install --upgrade langgraph
The --upgrade option installs LangGraph when it is absent and updates an older copy in the active environment.
- Inspect the installed langgraph package metadata.
$ python -m pip show langgraph Name: langgraph Version: 1.2.9 Summary: Building stateful, multi-actor applications with LLMs ##### snipped ##### Location: /home/alex/project/.venv/lib/python3.14/site-packages Requires: langchain-core, langgraph-checkpoint, langgraph-prebuilt, langgraph-sdk, pydantic, xxhash
The version and Python directory change over time. The Location value should point inside the project's .venv directory.
- Import StateGraph with the active environment's Python interpreter.
$ python -c "from langgraph.graph import StateGraph; print(StateGraph)" <class 'langgraph.graph.state.StateGraph'>
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.